From 3fb128f6f48272728785412ba2cacd280428bf63 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 16 Feb 2022 03:20:08 +0000 Subject: [PATCH] CodeGen from PR 17820 in Azure/azure-rest-api-specs Microsoft.App version 2022-01-01-preview (#17820) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New Swagger Spec File * New Swagger Example Spec File * New Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Go Language Readme Config File * New Python Language Readme Config File * New Typescript Language Readme Config File * New C# Language Readme Config File * Adding new API version 2022-01-01-preview for the new service Microsoft.App (#17135) * Adding swagger and examples * Fix samples * Fix linting errors * fix errors * fix more errors * prettier fixes * Fix the VNET properties * fix the vnet props * Attempt to remove x-ms-identifiers * Add x-ms-identifiers back * Revert "Add x-ms-identifiers back" This reverts commit 44525ab5ace45d9cb1bc85bee2751f015dcaffc6. * Addsourcecontrolapis (#17287) * add sourcecontrol apis * remove space * prettier fix * typo * avocado fix * lint fix * add replicas apis (#17501) * Remove Dapr components from ContainerApp spec. Not breaking because the version hasn't been released yet. (#17479) * Remove dapr components from the ContainerApp object * Fix example * add descriptions * fix * change the auto-rest parameters * Support volume mounts for containerApp (#17530) * add volume mounts * add identifier * refine volume definition * Fix samples (#17534) * Adding managed identity (#17569) * Adding managed identity * prettier fix. * Microsof.app 2022 01 01 preview/add custom domains (#17385) * add support for Custom domains and certificates * add Certificates * Ccertificate as child resource of Managed Env. * Support default custom domain * PUT/DELETE certificate are not long-running * Add Custom Domain Verification Id * domains for all revisions and adding examples * missing examples * one more missing example * Examples+missing paths * Adding missing envelope properties * Addressing PR comments * Removing AKV and Free cert related properties * Prettier and semantic validation fixes * Fixing semantic validations and examples * More fixes * Addressing more PR comments * Updating examples * fixing type * fixing types * Extra properties and responses * misplaced response * whitespace * fix security section * fixing ManageEnvironment securityDefinitions * add 204 delete response * Removing virtual IP and IP Based option * change modelAsString * Addressing ARM PR comments * Removing 404 response from example * renaming custom hostname analysis operation * mark certificate as tracked resource * fix sample * Use Certificate Id instead of Certificate name Co-authored-by: Ruslan Yakushev 🚴 Co-authored-by: vinisoto * Add new properties for ContainerApp (#17483) * add ephemeral storage * add outbound ip * add listsecrets * fix CI * fix example * fix * add identifier * fix * add example * mars as secret * Add storages operation for managedEnvironment (#17545) * add storage * fix * fix typo * Add EasyAuth configuration APIs for ContainerApp (#17492) * Add Easy Auth Config related APIs for ContainerApp * Use common type ProxyResource * Update description * update per validation * typo fix * fix validation error * Update sample and description * Update because ARM prefer string than boolean * Add static web identity provider * Add container probes (#17535) * Add container probes * minor fix * Use execute instead of exec'd, add identifier * remove exec from preview * use integer instead of intorstring * Add `internal` property under VnetConfiguration for internalOnly environments (#17656) * Add internal property under VnetConfiguration for internalOnly environments * Update examples * Add Dapr Components collection APIs (#17552) * Add daprComponents * update readme * Fix linting errors * More lint fixes * prettier fixes * make dapr component a tracked resource * fix the patch * fix lint errors * Revert "fix lint errors" This reverts commit 045f1d94bddf3527eab98b7a376070ab30fdd760. * Revert "fix the patch" This reverts commit 14521103e848e09762185f832c0270c16ed16efd. * Revert "make dapr component a tracked resource" This reverts commit 239268eda070ff37f26e8a772adacdd26bbf0937. * Fix linter issues * fix wrong fix * fix linter * fix the operationids (#17809) * correct resource name (#17846) * Add custom open id providers support (#17855) * Add custom open id providers support * Update description Co-authored-by: Xingjian Wang <79332479+xwang971@users.noreply.github.com> Co-authored-by: Zunli Hu Co-authored-by: Vaclav Turecek Co-authored-by: Vini Soto <18271663+vinisoto@users.noreply.github.com> Co-authored-by: vinisoto Co-authored-by: erich-wang Co-authored-by: Mike Vu Co-authored-by: Sanchit Mehta --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../azure-resourcemanager-app/CHANGELOG.md | 5 + sdk/app/azure-resourcemanager-app/README.md | 102 + sdk/app/azure-resourcemanager-app/SAMPLE.md | 1247 +++++++++++ sdk/app/azure-resourcemanager-app/pom.xml | 55 + .../app/ContainerAppsApiManager.java | 355 ++++ .../app/fluent/CertificatesClient.java | 186 ++ .../app/fluent/ContainerAppsApiClient.java | 116 ++ .../ContainerAppsAuthConfigsClient.java | 147 ++ .../app/fluent/ContainerAppsClient.java | 311 +++ .../ContainerAppsRevisionReplicasClient.java | 81 + .../fluent/ContainerAppsRevisionsClient.java | 169 ++ .../ContainerAppsSourceControlsClient.java | 220 ++ .../app/fluent/DaprComponentsClient.java | 145 ++ .../app/fluent/ManagedEnvironmentsClient.java | 253 +++ .../ManagedEnvironmentsStoragesClient.java | 146 ++ .../app/fluent/OperationsClient.java | 38 + .../app/fluent/models/AuthConfigInner.java | 190 ++ .../fluent/models/AuthConfigProperties.java | 187 ++ .../app/fluent/models/CertificateInner.java | 87 + .../app/fluent/models/ContainerAppInner.java | 209 ++ .../fluent/models/ContainerAppProperties.java | 187 ++ .../CustomHostnameAnalysisResultInner.java | 218 ++ ...ustomHostnameAnalysisResultProperties.java | 256 +++ .../app/fluent/models/DaprComponentInner.java | 224 ++ .../models/DaprComponentProperties.java | 215 ++ .../models/ManagedEnvironmentInner.java | 187 ++ .../models/ManagedEnvironmentProperties.java | 178 ++ .../ManagedEnvironmentStorageInner.java | 72 + ...gedEnvironmentStoragesCollectionInner.java | 59 + .../fluent/models/OperationDetailInner.java | 132 ++ .../fluent/models/ReplicaCollectionInner.java | 58 + .../app/fluent/models/ReplicaInner.java | 95 + .../app/fluent/models/ReplicaProperties.java | 71 + .../app/fluent/models/RevisionInner.java | 146 ++ .../app/fluent/models/RevisionProperties.java | 170 ++ .../fluent/models/SecretsCollectionInner.java | 59 + .../app/fluent/models/SourceControlInner.java | 142 ++ .../models/SourceControlProperties.java | 126 ++ .../app/fluent/models/package-info.java | 6 + .../app/fluent/package-info.java | 6 + .../app/implementation/AuthConfigImpl.java | 180 ++ .../app/implementation/CertificateImpl.java | 195 ++ .../CertificatesClientImpl.java | 1160 +++++++++++ .../app/implementation/CertificatesImpl.java | 198 ++ .../app/implementation/ContainerAppImpl.java | 248 +++ .../ContainerAppsApiClientBuilder.java | 146 ++ .../ContainerAppsApiClientImpl.java | 419 ++++ .../ContainerAppsAuthConfigsClientImpl.java | 917 +++++++++ .../ContainerAppsAuthConfigsImpl.java | 193 ++ .../ContainerAppsClientImpl.java | 1817 +++++++++++++++++ .../app/implementation/ContainerAppsImpl.java | 224 ++ ...ntainerAppsRevisionReplicasClientImpl.java | 443 ++++ .../ContainerAppsRevisionReplicasImpl.java | 91 + .../ContainerAppsRevisionsClientImpl.java | 1042 ++++++++++ .../ContainerAppsRevisionsImpl.java | 101 + ...ContainerAppsSourceControlsClientImpl.java | 1135 ++++++++++ .../ContainerAppsSourceControlsImpl.java | 196 ++ .../CustomHostnameAnalysisResultImpl.java | 114 ++ .../app/implementation/DaprComponentImpl.java | 213 ++ .../DaprComponentsClientImpl.java | 906 ++++++++ .../implementation/DaprComponentsImpl.java | 202 ++ .../ManagedEnvironmentImpl.java | 224 ++ .../ManagedEnvironmentStorageImpl.java | 143 ++ ...agedEnvironmentStoragesCollectionImpl.java | 48 + .../ManagedEnvironmentsClientImpl.java | 1456 +++++++++++++ .../ManagedEnvironmentsImpl.java | 179 ++ ...ManagedEnvironmentsStoragesClientImpl.java | 784 +++++++ .../ManagedEnvironmentsStoragesImpl.java | 212 ++ .../implementation/OperationDetailImpl.java | 45 + .../implementation/OperationsClientImpl.java | 273 +++ .../app/implementation/OperationsImpl.java | 46 + .../implementation/ReplicaCollectionImpl.java | 44 + .../app/implementation/ReplicaImpl.java | 61 + .../app/implementation/RevisionImpl.java | 84 + .../implementation/SecretsCollectionImpl.java | 40 + .../app/implementation/SourceControlImpl.java | 160 ++ .../app/implementation/Utils.java | 204 ++ .../app/implementation/package-info.java | 6 + .../app/models/AccessMode.java | 34 + .../app/models/ActiveRevisionsMode.java | 34 + .../models/AllowedAudiencesValidation.java | 54 + .../app/models/AppLogsConfiguration.java | 79 + .../app/models/AppProtocol.java | 34 + .../app/models/AppRegistration.java | 76 + .../resourcemanager/app/models/Apple.java | 111 + .../app/models/AppleRegistration.java | 76 + .../app/models/AuthConfig.java | 300 +++ .../app/models/AuthConfigCollection.java | 74 + .../app/models/AvailableOperations.java | 84 + .../app/models/AzureActiveDirectory.java | 143 ++ .../app/models/AzureActiveDirectoryLogin.java | 84 + .../AzureActiveDirectoryRegistration.java | 229 +++ .../AzureActiveDirectoryValidation.java | 54 + .../app/models/AzureCredentials.java | 128 ++ .../app/models/AzureFileProperties.java | 128 ++ .../app/models/AzureStaticWebApp.java | 83 + .../models/AzureStaticWebAppRegistration.java | 50 + .../app/models/BindingType.java | 34 + .../app/models/Certificate.java | 218 ++ .../app/models/CertificateCollection.java | 74 + .../app/models/CertificatePatch.java | 53 + .../app/models/CertificateProperties.java | 183 ++ .../app/models/Certificates.java | 155 ++ .../app/models/ClientRegistration.java | 76 + .../app/models/Configuration.java | 152 ++ .../resourcemanager/app/models/Container.java | 245 +++ .../app/models/ContainerApp.java | 327 +++ .../app/models/ContainerAppCollection.java | 74 + .../app/models/ContainerAppPatch.java | 53 + .../app/models/ContainerAppProbe.java | 309 +++ .../app/models/ContainerAppProbeHttpGet.java | 164 ++ ...ntainerAppProbeHttpGetHttpHeadersItem.java | 88 + .../models/ContainerAppProbeTcpSocket.java | 79 + .../models/ContainerAppProvisioningState.java | 40 + .../app/models/ContainerAppSecret.java | 54 + .../app/models/ContainerApps.java | 219 ++ .../app/models/ContainerAppsAuthConfigs.java | 154 ++ .../models/ContainerAppsRevisionReplicas.java | 73 + .../app/models/ContainerAppsRevisions.java | 156 ++ .../models/ContainerAppsSourceControls.java | 154 ++ .../app/models/ContainerResources.java | 91 + .../app/models/CustomDomain.java | 105 + .../models/CustomHostnameAnalysisResult.java | 119 ++ .../models/CustomOpenIdConnectProvider.java | 116 ++ .../app/models/CustomScaleRule.java | 110 + .../resourcemanager/app/models/Dapr.java | 131 ++ .../app/models/DaprComponent.java | 334 +++ .../app/models/DaprComponents.java | 154 ++ .../app/models/DaprComponentsCollection.java | 74 + .../app/models/DaprMetadata.java | 103 + .../app/models/DefaultErrorResponseError.java | 40 + .../DefaultErrorResponseErrorException.java | 37 + .../models/DisableWwwAuthenticateMode.java | 34 + .../app/models/DnsVerificationTestResult.java | 50 + .../app/models/EasyAuthState.java | 34 + .../models/EnvironmentProvisioningState.java | 61 + .../app/models/EnvironmentVar.java | 103 + .../resourcemanager/app/models/Facebook.java | 138 ++ .../resourcemanager/app/models/GitHub.java | 112 + .../app/models/GithubActionConfiguration.java | 212 ++ .../app/models/GlobalValidation.java | 90 + .../resourcemanager/app/models/Google.java | 142 ++ .../app/models/HttpScaleRule.java | 83 + .../app/models/HttpSettings.java | 85 + .../app/models/HttpSettingsRoute.java | 51 + .../app/models/IdentityProviderState.java | 34 + .../app/models/IdentityProviders.java | 303 +++ .../resourcemanager/app/models/Ingress.java | 205 ++ .../app/models/IngressTransportMethod.java | 37 + .../app/models/LegacyMicrosoftAccount.java | 147 ++ .../app/models/LogAnalyticsConfiguration.java | 76 + .../resourcemanager/app/models/Login.java | 119 ++ .../app/models/LoginRoute.java | 50 + .../app/models/LoginScopes.java | 51 + .../app/models/ManagedEnvironment.java | 289 +++ .../app/models/ManagedEnvironmentPatch.java | 53 + .../app/models/ManagedEnvironmentStorage.java | 157 ++ .../ManagedEnvironmentStorageProperties.java | 53 + .../ManagedEnvironmentStoragesCollection.java | 25 + .../app/models/ManagedEnvironments.java | 167 ++ .../models/ManagedEnvironmentsCollection.java | 75 + .../models/ManagedEnvironmentsStorages.java | 154 ++ .../app/models/ManagedServiceIdentity.java | 142 ++ .../models/ManagedServiceIdentityType.java | 41 + .../models/OpenIdConnectClientCredential.java | 53 + .../app/models/OpenIdConnectConfig.java | 157 ++ .../app/models/OpenIdConnectLogin.java | 77 + .../app/models/OpenIdConnectRegistration.java | 111 + .../app/models/OperationDetail.java | 45 + .../app/models/OperationDisplay.java | 128 ++ .../app/models/Operations.java | 33 + .../PreserveUrlFragmentsForLoginsMode.java | 34 + .../app/models/QueueScaleRule.java | 106 + .../app/models/RegistryCredentials.java | 102 + .../app/models/RegistryInfo.java | 102 + .../resourcemanager/app/models/Replica.java | 62 + .../app/models/ReplicaCollection.java | 25 + .../app/models/ReplicaContainer.java | 154 ++ .../app/models/RequireHttpsMode.java | 34 + .../resourcemanager/app/models/Revision.java | 111 + .../app/models/RevisionCollection.java | 74 + .../app/models/RevisionHealthState.java | 37 + .../app/models/RevisionProvisioningState.java | 43 + .../resourcemanager/app/models/Scale.java | 107 + .../resourcemanager/app/models/ScaleRule.java | 137 ++ .../app/models/ScaleRuleAuth.java | 76 + .../resourcemanager/app/models/Secret.java | 76 + .../app/models/SecretsCollection.java | 25 + .../app/models/SourceControl.java | 229 +++ .../app/models/SourceControlCollection.java | 74 + .../models/SourceControlOperationState.java | 40 + .../app/models/StorageType.java | 34 + .../resourcemanager/app/models/Template.java | 170 ++ .../app/models/TrafficWeight.java | 102 + .../resourcemanager/app/models/Twitter.java | 83 + .../app/models/TwitterRegistration.java | 86 + .../resourcemanager/app/models/Type.java | 37 + .../models/UnauthenticatedClientAction.java | 40 + .../app/models/UserAssignedIdentity.java | 55 + .../app/models/VnetConfiguration.java | 208 ++ .../resourcemanager/app/models/Volume.java | 102 + .../app/models/VolumeMount.java | 77 + .../app/models/package-info.java | 6 + .../resourcemanager/app/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../CertificatesCreateOrUpdateSamples.java | 31 + .../generated/CertificatesDeleteSamples.java | 24 + .../app/generated/CertificatesGetSamples.java | 24 + .../generated/CertificatesListSamples.java | 23 + .../generated/CertificatesUpdateSamples.java | 41 + ...rAppsAuthConfigsCreateOrUpdateSamples.java | 41 + ...ContainerAppsAuthConfigsDeleteSamples.java | 24 + .../ContainerAppsAuthConfigsGetSamples.java | 24 + ...sAuthConfigsListByContainerAppSamples.java | 22 + .../ContainerAppsCreateOrUpdateSamples.java | 115 ++ .../generated/ContainerAppsDeleteSamples.java | 22 + ...ontainerAppsGetByResourceGroupSamples.java | 22 + ...ntainerAppsListByResourceGroupSamples.java | 22 + ...AppsListCustomHostnameAnalysisSamples.java | 24 + .../generated/ContainerAppsListSamples.java | 22 + .../ContainerAppsListSecretsSamples.java | 22 + ...AppsRevisionReplicasGetReplicaSamples.java | 25 + ...psRevisionReplicasListReplicasSamples.java | 24 + ...rAppsRevisionsActivateRevisionSamples.java | 24 + ...ppsRevisionsDeactivateRevisionSamples.java | 24 + ...tainerAppsRevisionsGetRevisionSamples.java | 24 + ...inerAppsRevisionsListRevisionsSamples.java | 22 + ...erAppsRevisionsRestartRevisionSamples.java | 24 + ...psSourceControlsCreateOrUpdateSamples.java | 43 + ...tainerAppsSourceControlsDeleteSamples.java | 22 + ...ContainerAppsSourceControlsGetSamples.java | 24 + ...urceControlsListByContainerAppSamples.java | 22 + .../generated/ContainerAppsUpdateSamples.java | 38 + .../DaprComponentsCreateOrUpdateSamples.java | 41 + .../DaprComponentsDeleteSamples.java | 22 + .../generated/DaprComponentsGetSamples.java | 22 + .../generated/DaprComponentsListSamples.java | 22 + ...agedEnvironmentsCreateOrUpdateSamples.java | 32 + .../ManagedEnvironmentsDeleteSamples.java | 22 + ...EnvironmentsGetByResourceGroupSamples.java | 22 + ...nvironmentsListByResourceGroupSamples.java | 22 + .../ManagedEnvironmentsListSamples.java | 22 + ...ronmentsStoragesCreateOrUpdateSamples.java | 37 + ...agedEnvironmentsStoragesDeleteSamples.java | 23 + ...ManagedEnvironmentsStoragesGetSamples.java | 23 + ...anagedEnvironmentsStoragesListSamples.java | 23 + .../ManagedEnvironmentsUpdateSamples.java | 41 + .../app/generated/OperationsListSamples.java | 22 + sdk/app/ci.yml | 39 + sdk/app/pom.xml | 53 + 252 files changed, 35367 insertions(+) create mode 100644 sdk/app/azure-resourcemanager-app/CHANGELOG.md create mode 100644 sdk/app/azure-resourcemanager-app/README.md create mode 100644 sdk/app/azure-resourcemanager-app/SAMPLE.md create mode 100644 sdk/app/azure-resourcemanager-app/pom.xml create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/CertificatesClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsAuthConfigsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/DaprComponentsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CertificateInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SecretsCollectionInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/AuthConfigImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificateImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CustomHostnameAnalysisResultImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SecretsCollectionImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedAudiencesValidation.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Apple.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppleRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfig.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfigCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectory.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryLogin.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryValidation.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebApp.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/BindingType.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificate.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificatePatch.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificates.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbe.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGet.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGetHttpHeadersItem.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeTcpSocket.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppSecret.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsAuthConfigs.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomDomain.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomHostnameAnalysisResult.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomOpenIdConnectProvider.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponent.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponents.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponentsCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprMetadata.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DisableWwwAuthenticateMode.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DnsVerificationTestResult.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EasyAuthState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Facebook.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GitHub.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GlobalValidation.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Google.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettings.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoute.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviderState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviders.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LegacyMicrosoftAccount.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Login.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoute.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginScopes.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentity.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentityType.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectClientCredential.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectConfig.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectLogin.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/PreserveUrlFragmentsForLoginsMode.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RequireHttpsMode.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SecretsCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/StorageType.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Twitter.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TwitterRegistration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Type.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UnauthenticatedClientAction.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UserAssignedIdentity.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Volume.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VolumeMount.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/module-info.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesGetSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesListSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsGetSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListCustomHostnameAnalysisSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSecretsSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsGetSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsListSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.java create mode 100644 sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java create mode 100644 sdk/app/ci.yml create mode 100644 sdk/app/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 81c8f854c2260..dfbd6b1909412 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-app;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index b0c1dafb9f652..3ee70339c523e 100644 --- a/pom.xml +++ b/pom.xml @@ -844,6 +844,7 @@ sdk/anomalydetector sdk/aot sdk/apimanagement + sdk/app sdk/appconfiguration sdk/applicationinsights sdk/attestation diff --git a/sdk/app/azure-resourcemanager-app/CHANGELOG.md b/sdk/app/azure-resourcemanager-app/CHANGELOG.md new file mode 100644 index 0000000000000..7a963288f5ce4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-02-16) + +- Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-2022-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/app/azure-resourcemanager-app/README.md b/sdk/app/azure-resourcemanager-app/README.md new file mode 100644 index 0000000000000..336967abd6f57 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ContainerAppsApi client library for Java + +Azure Resource Manager ContainerAppsApi client library for Java. + +This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-2022-01-01-preview. 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 + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-app;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-app + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerAppsApiManager manager = ContainerAppsApiManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/app/azure-resourcemanager-app/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/app/azure-resourcemanager-app/SAMPLE.md b/sdk/app/azure-resourcemanager-app/SAMPLE.md new file mode 100644 index 0000000000000..dde987cb172fd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/SAMPLE.md @@ -0,0 +1,1247 @@ +# Code snippets and samples + + +## Certificates + +- [CreateOrUpdate](#certificates_createorupdate) +- [Delete](#certificates_delete) +- [Get](#certificates_get) +- [List](#certificates_list) +- [Update](#certificates_update) + +## ContainerApps + +- [CreateOrUpdate](#containerapps_createorupdate) +- [Delete](#containerapps_delete) +- [GetByResourceGroup](#containerapps_getbyresourcegroup) +- [List](#containerapps_list) +- [ListByResourceGroup](#containerapps_listbyresourcegroup) +- [ListCustomHostnameAnalysis](#containerapps_listcustomhostnameanalysis) +- [ListSecrets](#containerapps_listsecrets) +- [Update](#containerapps_update) + +## ContainerAppsAuthConfigs + +- [CreateOrUpdate](#containerappsauthconfigs_createorupdate) +- [Delete](#containerappsauthconfigs_delete) +- [Get](#containerappsauthconfigs_get) +- [ListByContainerApp](#containerappsauthconfigs_listbycontainerapp) + +## ContainerAppsRevisionReplicas + +- [GetReplica](#containerappsrevisionreplicas_getreplica) +- [ListReplicas](#containerappsrevisionreplicas_listreplicas) + +## ContainerAppsRevisions + +- [ActivateRevision](#containerappsrevisions_activaterevision) +- [DeactivateRevision](#containerappsrevisions_deactivaterevision) +- [GetRevision](#containerappsrevisions_getrevision) +- [ListRevisions](#containerappsrevisions_listrevisions) +- [RestartRevision](#containerappsrevisions_restartrevision) + +## ContainerAppsSourceControls + +- [CreateOrUpdate](#containerappssourcecontrols_createorupdate) +- [Delete](#containerappssourcecontrols_delete) +- [Get](#containerappssourcecontrols_get) +- [ListByContainerApp](#containerappssourcecontrols_listbycontainerapp) + +## DaprComponents + +- [CreateOrUpdate](#daprcomponents_createorupdate) +- [Delete](#daprcomponents_delete) +- [Get](#daprcomponents_get) +- [List](#daprcomponents_list) + +## ManagedEnvironments + +- [CreateOrUpdate](#managedenvironments_createorupdate) +- [Delete](#managedenvironments_delete) +- [GetByResourceGroup](#managedenvironments_getbyresourcegroup) +- [List](#managedenvironments_list) +- [ListByResourceGroup](#managedenvironments_listbyresourcegroup) +- [Update](#managedenvironments_update) + +## ManagedEnvironmentsStorages + +- [CreateOrUpdate](#managedenvironmentsstorages_createorupdate) +- [Delete](#managedenvironmentsstorages_delete) +- [Get](#managedenvironmentsstorages_get) +- [List](#managedenvironmentsstorages_list) + +## Operations + +- [List](#operations_list) +### Certificates_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.CertificateProperties; + +/** Samples for Certificates CreateOrUpdate. */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificate_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .certificates() + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingManagedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new CertificateProperties() + .withPassword("private key password") + .withValue("PFX-or-PEM-blob".getBytes())) + .create(); + } +} +``` + +### Certificates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificate_Delete.json + */ + /** + * Sample code: Delete Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .certificates() + .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + } +} +``` + +### Certificates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificate_Get.json + */ + /** + * Sample code: Get Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .certificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + } +} +``` + +### Certificates_List + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificates_ListByManagedEnvironment.json + */ + /** + * Sample code: List Certificates by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listCertificatesByManagedEnvironment( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.certificates().list("examplerg", "testcontainerenv", Context.NONE); + } +} +``` + +### Certificates_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.Certificate; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Certificates Update. */ +public final class CertificatesUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificates_Patch.json + */ + /** + * Sample code: Patch Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + Certificate resource = + manager + .certificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerApps_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AppProtocol; +import com.azure.resourcemanager.app.models.BindingType; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.Container; +import com.azure.resourcemanager.app.models.ContainerAppProbe; +import com.azure.resourcemanager.app.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.app.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.app.models.CustomDomain; +import com.azure.resourcemanager.app.models.CustomScaleRule; +import com.azure.resourcemanager.app.models.Dapr; +import com.azure.resourcemanager.app.models.Ingress; +import com.azure.resourcemanager.app.models.Scale; +import com.azure.resourcemanager.app.models.ScaleRule; +import com.azure.resourcemanager.app.models.Template; +import com.azure.resourcemanager.app.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps CreateOrUpdate. */ +public final class ContainerAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .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"))))) + .withTemplate( + new Template() + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("httpscalingrule") + .withCustom( + new CustomScaleRule() + .withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerApps_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerApps Delete. */ +public final class ContainerAppsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Delete.json + */ + /** + * Sample code: Delete Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().delete("rg", "testWorkerApp0", Context.NONE); + } +} +``` + +### ContainerApps_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerApps GetByResourceGroup. */ +public final class ContainerAppsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Get.json + */ + /** + * Sample code: Get Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE); + } +} +``` + +### ContainerApps_List + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerApps List. */ +public final class ContainerAppsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListBySubscription.json + */ + /** + * Sample code: List Container Apps by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().list(Context.NONE); + } +} +``` + +### ContainerApps_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerApps ListByResourceGroup. */ +public final class ContainerAppsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().listByResourceGroup("rg", Context.NONE); + } +} +``` + +### ContainerApps_ListCustomHostnameAnalysis + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerApps ListCustomHostnameAnalysis. */ +public final class ContainerAppsListCustomHostnameAnalysisSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json + */ + /** + * Sample code: Analyze Custom Hostname. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void analyzeCustomHostname(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerApps() + .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", Context.NONE); + } +} +``` + +### ContainerApps_ListSecrets + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerApps ListSecrets. */ +public final class ContainerAppsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListSecrets.json + */ + /** + * Sample code: List Container Apps Secrets. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsSecrets(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", Context.NONE); + } +} +``` + +### ContainerApps_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.ContainerApp; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps Update. */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Patch.json + */ + /** + * Sample code: Patch Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ContainerApp resource = + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ContainerAppsAuthConfigs_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AppRegistration; +import com.azure.resourcemanager.app.models.EasyAuthState; +import com.azure.resourcemanager.app.models.Facebook; +import com.azure.resourcemanager.app.models.GlobalValidation; +import com.azure.resourcemanager.app.models.IdentityProviders; +import com.azure.resourcemanager.app.models.UnauthenticatedClientAction; + +/** Samples for ContainerAppsAuthConfigs CreateOrUpdate. */ +public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppAuthConfig( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsAuthConfigs() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withState(EasyAuthState.ENABLED) + .withGlobalValidation( + new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientAction.ALLOW_ANONYMOUS)) + .withIdentityProviders( + new IdentityProviders() + .withFacebook( + new Facebook() + .withRegistration( + new AppRegistration().withAppId("123").withAppSecretRefName("facebook-secret")))) + .create(); + } +} +``` + +### ContainerAppsAuthConfigs_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsAuthConfigs Delete. */ +public final class ContainerAppsAuthConfigsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_Delete.json + */ + /** + * Sample code: Delete Container App AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppAuthConfig(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsAuthConfigs() + .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} +``` + +### ContainerAppsAuthConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsAuthConfigs Get. */ +public final class ContainerAppsAuthConfigsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_Get.json + */ + /** + * Sample code: Get Container App's AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSAuthConfig(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsAuthConfigs() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} +``` + +### ContainerAppsAuthConfigs_ListByContainerApp + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsAuthConfigs ListByContainerApp. */ +public final class ContainerAppsAuthConfigsListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_ListByContainer.json + */ + /** + * Sample code: List Auth Configs by Container Apps. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAuthConfigsByContainerApps(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + } +} +``` + +### ContainerAppsRevisionReplicas_GetReplica + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisionReplicas GetReplica. */ +public final class ContainerAppsRevisionReplicasGetReplicaSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Replicas_Get.json + */ + /** + * Sample code: Get Container App's revision replica. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevisionReplica(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .getReplicaWithResponse( + "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", Context.NONE); + } +} +``` + +### ContainerAppsRevisionReplicas_ListReplicas + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisionReplicas ListReplicas. */ +public final class ContainerAppsRevisionReplicasListReplicasSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Replicas_List.json + */ + /** + * Sample code: List Container App's replicas. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSReplicas(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", Context.NONE); + } +} +``` + +### ContainerAppsRevisions_ActivateRevision + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions ActivateRevision. */ +public final class ContainerAppsRevisionsActivateRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Activate.json + */ + /** + * Sample code: Activate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void activateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### ContainerAppsRevisions_DeactivateRevision + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions DeactivateRevision. */ +public final class ContainerAppsRevisionsDeactivateRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Deactivate.json + */ + /** + * Sample code: Deactivate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deactivateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### ContainerAppsRevisions_GetRevision + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions GetRevision. */ +public final class ContainerAppsRevisionsGetRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Get.json + */ + /** + * Sample code: Get Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### ContainerAppsRevisions_ListRevisions + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions ListRevisions. */ +public final class ContainerAppsRevisionsListRevisionsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_List.json + */ + /** + * Sample code: List Container App's revisions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSRevisions(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", Context.NONE); + } +} +``` + +### ContainerAppsRevisions_RestartRevision + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions RestartRevision. */ +public final class ContainerAppsRevisionsRestartRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Restart.json + */ + /** + * Sample code: Restart Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void restartContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### ContainerAppsSourceControls_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AzureCredentials; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.RegistryInfo; + +/** Samples for ContainerAppsSourceControls CreateOrUpdate. */ +public final class ContainerAppsSourceControlsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppSourceControl( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withRepoUrl("https://github.com/xwang971/ghatest") + .withBranch("master") + .withGithubActionConfiguration( + new GithubActionConfiguration() + .withRegistryInfo( + new RegistryInfo() + .withRegistryUrl("xwang971reg.azurecr.io") + .withRegistryUsername("xwang971reg") + .withRegistryPassword("")) + .withAzureCredentials( + new AzureCredentials() + .withClientId("") + .withClientSecret("") + .withTenantId(""))) + .create(); + } +} +``` + +### ContainerAppsSourceControls_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsSourceControls Delete. */ +public final class ContainerAppsSourceControlsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json + */ + /** + * Sample code: Delete Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} +``` + +### ContainerAppsSourceControls_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsSourceControls Get. */ +public final class ContainerAppsSourceControlsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json + */ + /** + * Sample code: Get Container App's SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} +``` + +### ContainerAppsSourceControls_ListByContainerApp + +```java +import com.azure.core.util.Context; + +/** Samples for ContainerAppsSourceControls ListByContainerApp. */ +public final class ContainerAppsSourceControlsListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_ListByContainer.json + */ + /** + * Sample code: List App's Source Controls. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAppSSourceControls(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + } +} +``` + +### DaprComponents_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import java.util.Arrays; + +/** Samples for DaprComponents CreateOrUpdate. */ +public final class DaprComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_CreateOrUpdate.json + */ + /** + * Sample code: Create or update dapr component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprComponent(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .daprComponents() + .define("reddog") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .create(); + } +} +``` + +### DaprComponents_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DaprComponents Delete. */ +public final class DaprComponentsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Delete.json + */ + /** + * Sample code: Delete dapr component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteDaprComponent(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.daprComponents().deleteWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + } +} +``` + +### DaprComponents_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DaprComponents Get. */ +public final class DaprComponentsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Get.json + */ + /** + * Sample code: Get Dapr Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprComponent(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + } +} +``` + +### DaprComponents_List + +```java +import com.azure.core.util.Context; + +/** Samples for DaprComponents List. */ +public final class DaprComponentsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_List.json + */ + /** + * Sample code: List Dapr Components. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listDaprComponents(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.daprComponents().list("examplerg", "myenvironment", Context.NONE); + } +} +``` + +### ManagedEnvironments_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.LogAnalyticsConfiguration; + +/** Samples for ManagedEnvironments CreateOrUpdate. */ +public final class ManagedEnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json + */ + /** + * Sample code: Create environments. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createEnvironments(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withAppLogsConfiguration( + new AppLogsConfiguration() + .withLogAnalyticsConfiguration( + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("string"))) + .create(); + } +} +``` + +### ManagedEnvironments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments Delete. */ +public final class ManagedEnvironmentsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Delete.json + */ + /** + * Sample code: Delete environment by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteEnvironmentByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + } +} +``` + +### ManagedEnvironments_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments GetByResourceGroup. */ +public final class ManagedEnvironmentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Get.json + */ + /** + * Sample code: Get environments by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getEnvironmentsByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", Context.NONE); + } +} +``` + +### ManagedEnvironments_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments List. */ +public final class ManagedEnvironmentsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_ListBySubscription.json + */ + /** + * Sample code: List environments by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().list(Context.NONE); + } +} +``` + +### ManagedEnvironments_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments ListByResourceGroup. */ +public final class ManagedEnvironmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json + */ + /** + * Sample code: List environments by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().listByResourceGroup("examplerg", Context.NONE); + } +} +``` + +### ManagedEnvironments_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.ManagedEnvironment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedEnvironments Update. */ +public final class ManagedEnvironmentsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Patch.json + */ + /** + * Sample code: Patch Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchManagedEnvironment(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ManagedEnvironment resource = + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "testcontainerenv", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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; + } +} +``` + +### ManagedEnvironmentsStorages_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AccessMode; +import com.azure.resourcemanager.app.models.AzureFileProperties; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; + +/** Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ +public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + */ + /** + * Sample code: Create or update environments storage. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateEnvironmentsStorage( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingManagedEnvironment("examplerg", "managedEnv") + .withProperties( + new ManagedEnvironmentStorageProperties() + .withAzureFile( + new AzureFileProperties() + .withAccountName("account1") + .withAccountKey("key") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) + .create(); + } +} +``` + +### ManagedEnvironmentsStorages_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironmentsStorages Delete. */ +public final class ManagedEnvironmentsStoragesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_Delete.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} +``` + +### ManagedEnvironmentsStorages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironmentsStorages Get. */ +public final class ManagedEnvironmentsStoragesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_Get.json + */ + /** + * Sample code: get a environments storage properties by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStoragePropertiesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} +``` + +### ManagedEnvironmentsStorages_List + +```java +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironmentsStorages List. */ +public final class ManagedEnvironmentsStoragesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_List.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Operations_List.json + */ + /** + * Sample code: List all operations. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAllOperations(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + diff --git a/sdk/app/azure-resourcemanager-app/pom.xml b/sdk/app/azure-resourcemanager-app/pom.xml new file mode 100644 index 0000000000000..50cc3bead9e15 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-app + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ContainerAppsApi Management + This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2022-01-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + + diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java new file mode 100644 index 0000000000000..4790ab39bb1c2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsApiClient; +import com.azure.resourcemanager.app.implementation.CertificatesImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsApiClientBuilder; +import com.azure.resourcemanager.app.implementation.ContainerAppsAuthConfigsImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsRevisionReplicasImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsRevisionsImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsSourceControlsImpl; +import com.azure.resourcemanager.app.implementation.DaprComponentsImpl; +import com.azure.resourcemanager.app.implementation.ManagedEnvironmentsImpl; +import com.azure.resourcemanager.app.implementation.ManagedEnvironmentsStoragesImpl; +import com.azure.resourcemanager.app.implementation.OperationsImpl; +import com.azure.resourcemanager.app.models.Certificates; +import com.azure.resourcemanager.app.models.ContainerApps; +import com.azure.resourcemanager.app.models.ContainerAppsAuthConfigs; +import com.azure.resourcemanager.app.models.ContainerAppsRevisionReplicas; +import com.azure.resourcemanager.app.models.ContainerAppsRevisions; +import com.azure.resourcemanager.app.models.ContainerAppsSourceControls; +import com.azure.resourcemanager.app.models.DaprComponents; +import com.azure.resourcemanager.app.models.ManagedEnvironments; +import com.azure.resourcemanager.app.models.ManagedEnvironmentsStorages; +import com.azure.resourcemanager.app.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ContainerAppsApiManager. */ +public final class ContainerAppsApiManager { + private ContainerApps containerApps; + + private ContainerAppsRevisions containerAppsRevisions; + + private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; + + private ManagedEnvironments managedEnvironments; + + private Certificates certificates; + + private Operations operations; + + private ContainerAppsSourceControls containerAppsSourceControls; + + private DaprComponents daprComponents; + + private ContainerAppsAuthConfigs containerAppsAuthConfigs; + + private ManagedEnvironmentsStorages managedEnvironmentsStorages; + + private final ContainerAppsApiClient clientObject; + + private ContainerAppsApiManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ContainerAppsApiClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerAppsApi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerAppsApi service API instance. + */ + public static ContainerAppsApiManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ContainerAppsApiManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerAppsApiManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerAppsApi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerAppsApi service API instance. + */ + public ContainerAppsApiManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.app") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerAppsApiManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ContainerApps. */ + public ContainerApps containerApps() { + if (this.containerApps == null) { + this.containerApps = new ContainerAppsImpl(clientObject.getContainerApps(), this); + } + return containerApps; + } + + /** @return Resource collection API of ContainerAppsRevisions. */ + public ContainerAppsRevisions containerAppsRevisions() { + if (this.containerAppsRevisions == null) { + this.containerAppsRevisions = + new ContainerAppsRevisionsImpl(clientObject.getContainerAppsRevisions(), this); + } + return containerAppsRevisions; + } + + /** @return Resource collection API of ContainerAppsRevisionReplicas. */ + public ContainerAppsRevisionReplicas containerAppsRevisionReplicas() { + if (this.containerAppsRevisionReplicas == null) { + this.containerAppsRevisionReplicas = + new ContainerAppsRevisionReplicasImpl(clientObject.getContainerAppsRevisionReplicas(), this); + } + return containerAppsRevisionReplicas; + } + + /** @return Resource collection API of ManagedEnvironments. */ + public ManagedEnvironments managedEnvironments() { + if (this.managedEnvironments == null) { + this.managedEnvironments = new ManagedEnvironmentsImpl(clientObject.getManagedEnvironments(), this); + } + return managedEnvironments; + } + + /** @return Resource collection API of Certificates. */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); + } + return certificates; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of ContainerAppsSourceControls. */ + public ContainerAppsSourceControls containerAppsSourceControls() { + if (this.containerAppsSourceControls == null) { + this.containerAppsSourceControls = + new ContainerAppsSourceControlsImpl(clientObject.getContainerAppsSourceControls(), this); + } + return containerAppsSourceControls; + } + + /** @return Resource collection API of DaprComponents. */ + public DaprComponents daprComponents() { + if (this.daprComponents == null) { + this.daprComponents = new DaprComponentsImpl(clientObject.getDaprComponents(), this); + } + return daprComponents; + } + + /** @return Resource collection API of ContainerAppsAuthConfigs. */ + public ContainerAppsAuthConfigs containerAppsAuthConfigs() { + if (this.containerAppsAuthConfigs == null) { + this.containerAppsAuthConfigs = + new ContainerAppsAuthConfigsImpl(clientObject.getContainerAppsAuthConfigs(), this); + } + return containerAppsAuthConfigs; + } + + /** @return Resource collection API of ManagedEnvironmentsStorages. */ + public ManagedEnvironmentsStorages managedEnvironmentsStorages() { + if (this.managedEnvironmentsStorages == null) { + this.managedEnvironmentsStorages = + new ManagedEnvironmentsStoragesImpl(clientObject.getManagedEnvironmentsStorages(), this); + } + return managedEnvironmentsStorages; + } + + /** + * @return Wrapped service client ContainerAppsApiClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public ContainerAppsApiClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/CertificatesClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/CertificatesClient.java new file mode 100644 index 0000000000000..9501cab732d29 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/CertificatesClient.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.CertificateInner; +import com.azure.resourcemanager.app.models.CertificatePatch; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public interface CertificatesClient { + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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) + PagedIterable list(String resourceGroupName, String managedEnvironmentName); + + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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.app.models.DefaultErrorResponseErrorException 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) + PagedIterable list(String resourceGroupName, String managedEnvironmentName, Context context); + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateInner get(String resourceGroupName, String managedEnvironmentName, String name); + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String managedEnvironmentName, String name, Context context); + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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 managedEnvironmentName, String name); + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException 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 managedEnvironmentName, + String name, + CertificateInner certificateEnvelope, + Context context); + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 managedEnvironmentName, String name); + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown 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 managedEnvironmentName, String name, Context context); + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException 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 managedEnvironmentName, String name, CertificatePatch certificateEnvelope); + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException 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 updateWithResponse( + String resourceGroupName, + String managedEnvironmentName, + String name, + CertificatePatch certificateEnvelope, + Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java new file mode 100644 index 0000000000000..df18deecb633d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerAppsApiClient class. */ +public interface ContainerAppsApiClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ContainerAppsClient object to access its operations. + * + * @return the ContainerAppsClient object. + */ + ContainerAppsClient getContainerApps(); + + /** + * Gets the ContainerAppsRevisionsClient object to access its operations. + * + * @return the ContainerAppsRevisionsClient object. + */ + ContainerAppsRevisionsClient getContainerAppsRevisions(); + + /** + * Gets the ContainerAppsRevisionReplicasClient object to access its operations. + * + * @return the ContainerAppsRevisionReplicasClient object. + */ + ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas(); + + /** + * Gets the ManagedEnvironmentsClient object to access its operations. + * + * @return the ManagedEnvironmentsClient object. + */ + ManagedEnvironmentsClient getManagedEnvironments(); + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + CertificatesClient getCertificates(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ContainerAppsSourceControlsClient object to access its operations. + * + * @return the ContainerAppsSourceControlsClient object. + */ + ContainerAppsSourceControlsClient getContainerAppsSourceControls(); + + /** + * Gets the DaprComponentsClient object to access its operations. + * + * @return the DaprComponentsClient object. + */ + DaprComponentsClient getDaprComponents(); + + /** + * Gets the ContainerAppsAuthConfigsClient object to access its operations. + * + * @return the ContainerAppsAuthConfigsClient object. + */ + ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs(); + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsAuthConfigsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsAuthConfigsClient.java new file mode 100644 index 0000000000000..7441b0a878ca5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsAuthConfigsClient.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.AuthConfigInner; + +/** 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.app.models.DefaultErrorResponseErrorException 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.app.models.DefaultErrorResponseErrorException 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthConfigInner get(String resourceGroupName, String containerAppName, String name); + + /** + * 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 name 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.app.models.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AuthConfigInner createOrUpdate( + String resourceGroupName, String containerAppName, String name, AuthConfigInner authConfigEnvelope); + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String containerAppName, + String name, + AuthConfigInner authConfigEnvelope, + Context context); + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String name); + + /** + * Description for 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. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java new file mode 100644 index 0000000000000..6ab45551ba02d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.fluent.models.CustomHostnameAnalysisResultInner; +import com.azure.resourcemanager.app.fluent.models.SecretsCollectionInner; +import com.azure.resourcemanager.app.models.ContainerAppPatch; + +/** An instance of this class provides access to all the operations defined in ContainerAppsClient. */ +public interface ContainerAppsClient { + /** + * Get the Container Apps in a given subscription. + * + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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) + PagedIterable list(); + + /** + * Get the Container Apps in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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) + PagedIterable list(Context context); + + /** + * 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 com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the Container Apps in a given 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.app.models.DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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, String name, ContainerAppInner containerAppEnvelope); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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, String name, ContainerAppInner containerAppEnvelope, Context context); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner createOrUpdate(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner createOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 name); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown 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 name, Context context); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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 name, Context context); + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner update(String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope); + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope, Context context); + + /** + * Analyzes a custom hostname 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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain analysis. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomHostnameAnalysisResultInner listCustomHostnameAnalysis(String resourceGroupName, String containerAppName); + + /** + * Analyzes a custom hostname 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 customHostname Custom hostname. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain analysis along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listCustomHostnameAnalysisWithResponse( + String resourceGroupName, String containerAppName, String customHostname, Context context); + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretsCollectionInner listSecrets(String resourceGroupName, String name); + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.models.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 Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse(String resourceGroupName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.java new file mode 100644 index 0000000000000..8e8efcff0ad66 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionReplicasClient. */ +public interface ContainerAppsRevisionReplicasClient { + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 replica for a Container App Revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicaInner getReplica(String resourceGroupName, String containerAppName, String revisionName, String name); + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 replica for a Container App Revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context); + + /** + * List replicas for 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Revision Replicas collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicaCollectionInner listReplicas(String resourceGroupName, String containerAppName, String revisionName); + + /** + * List replicas for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Revision Replicas collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java new file mode 100644 index 0000000000000..e57337f73dbd1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.RevisionInner; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionsClient. */ +public interface ContainerAppsRevisionsClient { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName, 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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) + RevisionInner getRevision(String resourceGroupName, String containerAppName, String name); + + /** + * 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 name 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.app.models.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) + Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Activates a revision 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 activateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Activates a revision 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Deactivates a revision 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 deactivateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Deactivates a revision 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Restarts a revision 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 restartRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Restarts a revision 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java new file mode 100644 index 0000000000000..a06316229012b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.SourceControlInner; + +/** 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.app.models.DefaultErrorResponseErrorException 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.app.models.DefaultErrorResponseErrorException 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner get(String resourceGroupName, String containerAppName, String name); + + /** + * 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 name 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.app.models.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner createOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner createOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context); + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 name); + + /** + * Description for 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 name, Context context); + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String name); + + /** + * Description for 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 name 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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/DaprComponentsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/DaprComponentsClient.java new file mode 100644 index 0000000000000..2dea94f6c05c7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/DaprComponentsClient.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.DaprComponentInner; + +/** 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.app.models.DefaultErrorResponseErrorException 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.app.models.DefaultErrorResponseErrorException 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprComponentInner get(String resourceGroupName, String environmentName, String name); + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String environmentName, String name, Context context); + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprComponentInner createOrUpdate( + String resourceGroupName, String environmentName, String name, DaprComponentInner daprComponentEnvelope); + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details 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.app.models.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String environmentName, + String name, + DaprComponentInner daprComponentEnvelope, + Context context); + + /** + * Delete a Dapr 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 Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Dapr 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 Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String environmentName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java new file mode 100644 index 0000000000000..5611912295bf0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentPatch; + +/** An instance of this class provides access to all the operations defined in ManagedEnvironmentsClient. */ +public interface ManagedEnvironmentsClient { + /** + * Get all Managed Environments for a subscription. + * + * @throws com.azure.resourcemanager.app.models.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) + PagedIterable list(); + + /** + * Get all Managed Environments for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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) + PagedIterable list(Context context); + + /** + * 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 com.azure.resourcemanager.app.models.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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 com.azure.resourcemanager.app.models.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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String name); + + /** + * 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 name 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.app.models.DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context); + + /** + * 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 name Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 name, ManagedEnvironmentInner environmentEnvelope); + + /** + * 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 name, ManagedEnvironmentInner environmentEnvelope, Context context); + + /** + * 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 name Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 hosting container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentInner createOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope); + + /** + * 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 name 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.app.models.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 hosting container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentInner createOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context); + + /** + * 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 name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 name); + + /** + * 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 name, Context context); + + /** + * 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 name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name); + + /** + * 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 name 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.app.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 name, Context context); + + /** + * 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 name Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 hosting container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentInner update(String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope); + + /** + * 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 name 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.app.models.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 hosting container apps along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java new file mode 100644 index 0000000000000..dc5e00f45907e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; + +/** 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 envName Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 envName); + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName 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.app.models.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 envName, Context context); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentStorageInner get(String resourceGroupName, String envName, String name); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name 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.app.models.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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String envName, String name, Context context); + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 resource for managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentStorageInner createOrUpdate( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope); + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 resource for managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String envName, + String name, + ManagedEnvironmentStorageInner storageEnvelope, + Context context); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 envName, String name); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown 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 envName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java new file mode 100644 index 0000000000000..7f52bf81dc449 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.OperationDetailInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available RP operations. + * + * @throws com.azure.resourcemanager.app.models.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 operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigInner.java new file mode 100644 index 0000000000000..0ea8d7ad60bd9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigInner.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.EasyAuthState; +import com.azure.resourcemanager.app.models.GlobalValidation; +import com.azure.resourcemanager.app.models.HttpSettings; +import com.azure.resourcemanager.app.models.IdentityProviders; +import com.azure.resourcemanager.app.models.Login; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration settings for the Azure ContainerApp Authentication / Authorization feature. */ +@Fluent +public final class AuthConfigInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthConfigInner.class); + + /* + * Easy Auth configuration resource specific properties + */ + @JsonProperty(value = "properties") + private AuthConfigProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Easy Auth configuration resource specific properties. + * + * @return the innerProperties value. + */ + private AuthConfigProperties 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 state property: <code>Enabled</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>Disabled</code>. + * + * @return the state value. + */ + public EasyAuthState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Set the state property: <code>Enabled</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>Disabled</code>. + * + * @param state the state value to set. + * @return the AuthConfigInner object itself. + */ + public AuthConfigInner withState(EasyAuthState state) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthConfigProperties(); + } + this.innerProperties().withState(state); + return this; + } + + /** + * Get the globalValidation property: The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * + * @return the globalValidation value. + */ + public GlobalValidation globalValidation() { + return this.innerProperties() == null ? null : this.innerProperties().globalValidation(); + } + + /** + * Set the globalValidation property: The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * + * @param globalValidation the globalValidation value to set. + * @return the AuthConfigInner object itself. + */ + public AuthConfigInner withGlobalValidation(GlobalValidation globalValidation) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthConfigProperties(); + } + this.innerProperties().withGlobalValidation(globalValidation); + return this; + } + + /** + * Get the identityProviders property: The configuration settings of each of the identity providers used to + * configure ContainerApp Authentication/Authorization. + * + * @return the identityProviders value. + */ + public IdentityProviders identityProviders() { + return this.innerProperties() == null ? null : this.innerProperties().identityProviders(); + } + + /** + * Set the identityProviders property: The configuration settings of each of the identity providers used to + * configure ContainerApp Authentication/Authorization. + * + * @param identityProviders the identityProviders value to set. + * @return the AuthConfigInner object itself. + */ + public AuthConfigInner withIdentityProviders(IdentityProviders identityProviders) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthConfigProperties(); + } + this.innerProperties().withIdentityProviders(identityProviders); + return this; + } + + /** + * Get the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * + * @return the login value. + */ + public Login login() { + return this.innerProperties() == null ? null : this.innerProperties().login(); + } + + /** + * Set the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * + * @param login the login value to set. + * @return the AuthConfigInner object itself. + */ + public AuthConfigInner withLogin(Login login) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthConfigProperties(); + } + this.innerProperties().withLogin(login); + return this; + } + + /** + * Get the httpSettings property: The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp Authentication/Authorization. + * + * @return the httpSettings value. + */ + public HttpSettings httpSettings() { + return this.innerProperties() == null ? null : this.innerProperties().httpSettings(); + } + + /** + * Set the httpSettings property: The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp Authentication/Authorization. + * + * @param httpSettings the httpSettings value to set. + * @return the AuthConfigInner object itself. + */ + public AuthConfigInner withHttpSettings(HttpSettings httpSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthConfigProperties(); + } + this.innerProperties().withHttpSettings(httpSettings); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigProperties.java new file mode 100644 index 0000000000000..d285a9d385617 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigProperties.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.EasyAuthState; +import com.azure.resourcemanager.app.models.GlobalValidation; +import com.azure.resourcemanager.app.models.HttpSettings; +import com.azure.resourcemanager.app.models.IdentityProviders; +import com.azure.resourcemanager.app.models.Login; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Easy Auth configuration resource specific properties. */ +@Fluent +public final class AuthConfigProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthConfigProperties.class); + + /* + * Enabled if the Authentication / Authorization feature is + * enabled for the current app; otherwise, Disabled. + */ + @JsonProperty(value = "state") + private EasyAuthState state; + + /* + * The configuration settings that determines the validation flow of users + * using ContainerApp Authentication/Authorization. + */ + @JsonProperty(value = "globalValidation") + private GlobalValidation globalValidation; + + /* + * The configuration settings of each of the identity providers used to + * configure ContainerApp Authentication/Authorization. + */ + @JsonProperty(value = "identityProviders") + private IdentityProviders identityProviders; + + /* + * The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + */ + @JsonProperty(value = "login") + private Login login; + + /* + * The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp + * Authentication/Authorization. + */ + @JsonProperty(value = "httpSettings") + private HttpSettings httpSettings; + + /** + * Get the state property: <code>Enabled</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>Disabled</code>. + * + * @return the state value. + */ + public EasyAuthState state() { + return this.state; + } + + /** + * Set the state property: <code>Enabled</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>Disabled</code>. + * + * @param state the state value to set. + * @return the AuthConfigProperties object itself. + */ + public AuthConfigProperties withState(EasyAuthState state) { + this.state = state; + return this; + } + + /** + * Get the globalValidation property: The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * + * @return the globalValidation value. + */ + public GlobalValidation globalValidation() { + return this.globalValidation; + } + + /** + * Set the globalValidation property: The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * + * @param globalValidation the globalValidation value to set. + * @return the AuthConfigProperties object itself. + */ + public AuthConfigProperties withGlobalValidation(GlobalValidation globalValidation) { + this.globalValidation = globalValidation; + return this; + } + + /** + * Get the identityProviders property: The configuration settings of each of the identity providers used to + * configure ContainerApp Authentication/Authorization. + * + * @return the identityProviders value. + */ + public IdentityProviders identityProviders() { + return this.identityProviders; + } + + /** + * Set the identityProviders property: The configuration settings of each of the identity providers used to + * configure ContainerApp Authentication/Authorization. + * + * @param identityProviders the identityProviders value to set. + * @return the AuthConfigProperties object itself. + */ + public AuthConfigProperties withIdentityProviders(IdentityProviders identityProviders) { + this.identityProviders = identityProviders; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * + * @return the login value. + */ + public Login login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * + * @param login the login value to set. + * @return the AuthConfigProperties object itself. + */ + public AuthConfigProperties withLogin(Login login) { + this.login = login; + return this; + } + + /** + * Get the httpSettings property: The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp Authentication/Authorization. + * + * @return the httpSettings value. + */ + public HttpSettings httpSettings() { + return this.httpSettings; + } + + /** + * Set the httpSettings property: The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp Authentication/Authorization. + * + * @param httpSettings the httpSettings value to set. + * @return the AuthConfigProperties object itself. + */ + public AuthConfigProperties withHttpSettings(HttpSettings httpSettings) { + this.httpSettings = httpSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (globalValidation() != null) { + globalValidation().validate(); + } + if (identityProviders() != null) { + identityProviders().validate(); + } + if (login() != null) { + login().validate(); + } + if (httpSettings() != null) { + httpSettings().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CertificateInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CertificateInner.java new file mode 100644 index 0000000000000..281a411a1bc6d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CertificateInner.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ +@Fluent +public final class CertificateInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateInner.class); + + /* + * Certificate resource specific properties + */ + @JsonProperty(value = "properties") + private CertificateProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Certificate resource specific properties. + * + * @return the properties value. + */ + public CertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Certificate resource specific properties. + * + * @param properties the properties value to set. + * @return the CertificateInner object itself. + */ + public CertificateInner withProperties(CertificateProperties 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; + } + + /** {@inheritDoc} */ + @Override + public CertificateInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public CertificateInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java new file mode 100644 index 0000000000000..23ece6d455332 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.ContainerAppProvisioningState; +import com.azure.resourcemanager.app.models.ManagedServiceIdentity; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App. */ +@Fluent +public final class ContainerAppInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppInner.class); + + /* + * managed identities for the Container App to interact with other Azure + * services without maintaining any secrets or credentials in code. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * ContainerApp resource specific properties + */ + @JsonProperty(value = "properties") + private ContainerAppProperties innerProperties; + + /** + * Get the identity property: managed identities for the Container App to interact with other Azure services without + * maintaining any secrets or credentials in code. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: managed identities for the Container App to interact with other Azure services without + * maintaining any secrets or credentials in code. + * + * @param identity the identity value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: ContainerApp resource specific properties. + * + * @return the innerProperties value. + */ + private ContainerAppProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ContainerAppInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerAppInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Container App. + * + * @return the provisioningState value. + */ + public ContainerAppProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @return the managedEnvironmentId value. + */ + public String managedEnvironmentId() { + return this.innerProperties() == null ? null : this.innerProperties().managedEnvironmentId(); + } + + /** + * Set the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @param managedEnvironmentId the managedEnvironmentId value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withManagedEnvironmentId(String managedEnvironmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withManagedEnvironmentId(managedEnvironmentId); + return this; + } + + /** + * Get the latestRevisionName property: Name of the latest revision of the Container App. + * + * @return the latestRevisionName value. + */ + public String latestRevisionName() { + return this.innerProperties() == null ? null : this.innerProperties().latestRevisionName(); + } + + /** + * Get the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. + * + * @return the latestRevisionFqdn value. + */ + public String latestRevisionFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().latestRevisionFqdn(); + } + + /** + * Get the customDomainVerificationId property: Id used to verify domain name ownership. + * + * @return the customDomainVerificationId value. + */ + public String customDomainVerificationId() { + return this.innerProperties() == null ? null : this.innerProperties().customDomainVerificationId(); + } + + /** + * Get the configuration property: Non versioned Container App configuration properties. + * + * @return the configuration value. + */ + public Configuration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: Non versioned Container App configuration properties. + * + * @param configuration the configuration value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withConfiguration(Configuration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the template property: Container App versioned application definition. + * + * @return the template value. + */ + public Template template() { + return this.innerProperties() == null ? null : this.innerProperties().template(); + } + + /** + * Set the template property: Container App versioned application definition. + * + * @param template the template value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withTemplate(Template template) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withTemplate(template); + return this; + } + + /** + * Get the outboundIpAddresses property: Outbound IP Addresses for container app. + * + * @return the outboundIpAddresses value. + */ + public List outboundIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().outboundIpAddresses(); + } + + /** + * 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java new file mode 100644 index 0000000000000..26e17b854dfed --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.ContainerAppProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ContainerApp resource specific properties. */ +@Fluent +public final class ContainerAppProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppProperties.class); + + /* + * Provisioning state of the Container App. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerAppProvisioningState provisioningState; + + /* + * Resource ID of the Container App's environment. + */ + @JsonProperty(value = "managedEnvironmentId") + private String managedEnvironmentId; + + /* + * Name of the latest revision of the Container App. + */ + @JsonProperty(value = "latestRevisionName", access = JsonProperty.Access.WRITE_ONLY) + private String latestRevisionName; + + /* + * Fully Qualified Domain Name of the latest revision of the Container App. + */ + @JsonProperty(value = "latestRevisionFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String latestRevisionFqdn; + + /* + * Id used to verify domain name ownership + */ + @JsonProperty(value = "customDomainVerificationId", access = JsonProperty.Access.WRITE_ONLY) + private String customDomainVerificationId; + + /* + * Non versioned Container App configuration properties. + */ + @JsonProperty(value = "configuration") + private Configuration configuration; + + /* + * Container App versioned application definition. + */ + @JsonProperty(value = "template") + private Template template; + + /* + * Outbound IP Addresses for container app. + */ + @JsonProperty(value = "outboundIPAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List outboundIpAddresses; + + /** + * Get the provisioningState property: Provisioning state of the Container App. + * + * @return the provisioningState value. + */ + public ContainerAppProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @return the managedEnvironmentId value. + */ + public String managedEnvironmentId() { + return this.managedEnvironmentId; + } + + /** + * Set the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @param managedEnvironmentId the managedEnvironmentId value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties withManagedEnvironmentId(String managedEnvironmentId) { + this.managedEnvironmentId = managedEnvironmentId; + return this; + } + + /** + * Get the latestRevisionName property: Name of the latest revision of the Container App. + * + * @return the latestRevisionName value. + */ + public String latestRevisionName() { + return this.latestRevisionName; + } + + /** + * Get the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. + * + * @return the latestRevisionFqdn value. + */ + public String latestRevisionFqdn() { + return this.latestRevisionFqdn; + } + + /** + * Get the customDomainVerificationId property: Id used to verify domain name ownership. + * + * @return the customDomainVerificationId value. + */ + public String customDomainVerificationId() { + return this.customDomainVerificationId; + } + + /** + * Get the configuration property: Non versioned Container App configuration properties. + * + * @return the configuration value. + */ + public Configuration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Non versioned Container App configuration properties. + * + * @param configuration the configuration value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties withConfiguration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the template property: Container App versioned application definition. + * + * @return the template value. + */ + public Template template() { + return this.template; + } + + /** + * Set the template property: Container App versioned application definition. + * + * @param template the template value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties withTemplate(Template template) { + this.template = template; + return this; + } + + /** + * Get the outboundIpAddresses property: Outbound IP Addresses for container app. + * + * @return the outboundIpAddresses value. + */ + public List outboundIpAddresses() { + return this.outboundIpAddresses; + } + + /** + * 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultInner.java new file mode 100644 index 0000000000000..4e1fb4835f42b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultInner.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.DefaultErrorResponseError; +import com.azure.resourcemanager.app.models.DnsVerificationTestResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Custom domain analysis. */ +@Fluent +public final class CustomHostnameAnalysisResultInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomHostnameAnalysisResultInner.class); + + /* + * CustomHostnameAnalysisResult resource specific properties + */ + @JsonProperty(value = "properties") + private CustomHostnameAnalysisResultProperties innerProperties; + + /** + * Get the innerProperties property: CustomHostnameAnalysisResult resource specific properties. + * + * @return the innerProperties value. + */ + private CustomHostnameAnalysisResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the hostname property: Host name that was analyzed. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the isHostnameAlreadyVerified property: <code>true</code> if hostname is already verified; + * otherwise, <code>false</code>. + * + * @return the isHostnameAlreadyVerified value. + */ + public Boolean isHostnameAlreadyVerified() { + return this.innerProperties() == null ? null : this.innerProperties().isHostnameAlreadyVerified(); + } + + /** + * Get the customDomainVerificationTest property: DNS verification test result. + * + * @return the customDomainVerificationTest value. + */ + public DnsVerificationTestResult customDomainVerificationTest() { + return this.innerProperties() == null ? null : this.innerProperties().customDomainVerificationTest(); + } + + /** + * Get the customDomainVerificationFailureInfo property: Raw failure information if DNS verification fails. + * + * @return the customDomainVerificationFailureInfo value. + */ + public DefaultErrorResponseError customDomainVerificationFailureInfo() { + return this.innerProperties() == null ? null : this.innerProperties().customDomainVerificationFailureInfo(); + } + + /** + * Get the hasConflictOnManagedEnvironment property: <code>true</code> if there is a conflict on the + * Container App's managed environment; otherwise, <code>false</code>. + * + * @return the hasConflictOnManagedEnvironment value. + */ + public Boolean hasConflictOnManagedEnvironment() { + return this.innerProperties() == null ? null : this.innerProperties().hasConflictOnManagedEnvironment(); + } + + /** + * Get the conflictingContainerAppResourceId property: Name of the conflicting Container App on the Managed + * Environment if it's within the same subscription. + * + * @return the conflictingContainerAppResourceId value. + */ + public String conflictingContainerAppResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().conflictingContainerAppResourceId(); + } + + /** + * Get the cNameRecords property: CName records visible for this hostname. + * + * @return the cNameRecords value. + */ + public List cNameRecords() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomHostnameAnalysisResultProperties(); + } + this.innerProperties().withCNameRecords(cNameRecords); + return this; + } + + /** + * Get the txtRecords property: TXT records visible for this hostname. + * + * @return the txtRecords value. + */ + public List txtRecords() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomHostnameAnalysisResultProperties(); + } + this.innerProperties().withTxtRecords(txtRecords); + return this; + } + + /** + * Get the aRecords property: A records visible for this hostname. + * + * @return the aRecords value. + */ + public List aRecords() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomHostnameAnalysisResultProperties(); + } + this.innerProperties().withARecords(aRecords); + return this; + } + + /** + * Get the alternateCNameRecords property: Alternate CName records visible for this hostname. + * + * @return the alternateCNameRecords value. + */ + public List alternateCNameRecords() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomHostnameAnalysisResultProperties(); + } + this.innerProperties().withAlternateCNameRecords(alternateCNameRecords); + return this; + } + + /** + * Get the alternateTxtRecords property: Alternate TXT records visible for this hostname. + * + * @return the alternateTxtRecords value. + */ + public List alternateTxtRecords() { + return this.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new CustomHostnameAnalysisResultProperties(); + } + this.innerProperties().withAlternateTxtRecords(alternateTxtRecords); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultProperties.java new file mode 100644 index 0000000000000..1f62ee7e85b5f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultProperties.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.DefaultErrorResponseError; +import com.azure.resourcemanager.app.models.DnsVerificationTestResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CustomHostnameAnalysisResult resource specific properties. */ +@Fluent +public final class CustomHostnameAnalysisResultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomHostnameAnalysisResultProperties.class); + + /* + * Host name that was analyzed + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * true if hostname is already verified; otherwise, + * false. + */ + @JsonProperty(value = "isHostnameAlreadyVerified", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isHostnameAlreadyVerified; + + /* + * DNS verification test result. + */ + @JsonProperty(value = "customDomainVerificationTest", access = JsonProperty.Access.WRITE_ONLY) + private DnsVerificationTestResult customDomainVerificationTest; + + /* + * Raw failure information if DNS verification fails. + */ + @JsonProperty(value = "customDomainVerificationFailureInfo", access = JsonProperty.Access.WRITE_ONLY) + private DefaultErrorResponseError customDomainVerificationFailureInfo; + + /* + * true if there is a conflict on the Container App's managed + * environment; otherwise, false. + */ + @JsonProperty(value = "hasConflictOnManagedEnvironment", access = JsonProperty.Access.WRITE_ONLY) + private Boolean hasConflictOnManagedEnvironment; + + /* + * Name of the conflicting Container App on the Managed Environment if it's + * within the same subscription. + */ + @JsonProperty(value = "conflictingContainerAppResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String conflictingContainerAppResourceId; + + /* + * CName records visible for this hostname. + */ + @JsonProperty(value = "cNameRecords") + private List cNameRecords; + + /* + * TXT records visible for this hostname. + */ + @JsonProperty(value = "txtRecords") + private List txtRecords; + + /* + * A records visible for this hostname. + */ + @JsonProperty(value = "aRecords") + private List aRecords; + + /* + * Alternate CName records visible for this hostname. + */ + @JsonProperty(value = "alternateCNameRecords") + private List alternateCNameRecords; + + /* + * Alternate TXT records visible for this hostname. + */ + @JsonProperty(value = "alternateTxtRecords") + private List alternateTxtRecords; + + /** + * Get the hostname property: Host name that was analyzed. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the isHostnameAlreadyVerified property: <code>true</code> if hostname is already verified; + * otherwise, <code>false</code>. + * + * @return the isHostnameAlreadyVerified value. + */ + public Boolean isHostnameAlreadyVerified() { + return this.isHostnameAlreadyVerified; + } + + /** + * Get the customDomainVerificationTest property: DNS verification test result. + * + * @return the customDomainVerificationTest value. + */ + public DnsVerificationTestResult customDomainVerificationTest() { + return this.customDomainVerificationTest; + } + + /** + * Get the customDomainVerificationFailureInfo property: Raw failure information if DNS verification fails. + * + * @return the customDomainVerificationFailureInfo value. + */ + public DefaultErrorResponseError customDomainVerificationFailureInfo() { + return this.customDomainVerificationFailureInfo; + } + + /** + * Get the hasConflictOnManagedEnvironment property: <code>true</code> if there is a conflict on the + * Container App's managed environment; otherwise, <code>false</code>. + * + * @return the hasConflictOnManagedEnvironment value. + */ + public Boolean hasConflictOnManagedEnvironment() { + return this.hasConflictOnManagedEnvironment; + } + + /** + * Get the conflictingContainerAppResourceId property: Name of the conflicting Container App on the Managed + * Environment if it's within the same subscription. + * + * @return the conflictingContainerAppResourceId value. + */ + public String conflictingContainerAppResourceId() { + return this.conflictingContainerAppResourceId; + } + + /** + * Get the cNameRecords property: CName records visible for this hostname. + * + * @return the cNameRecords value. + */ + 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 CustomHostnameAnalysisResultProperties object itself. + */ + public CustomHostnameAnalysisResultProperties withCNameRecords(List cNameRecords) { + this.cNameRecords = cNameRecords; + return this; + } + + /** + * Get the txtRecords property: TXT records visible for this hostname. + * + * @return the txtRecords value. + */ + 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 CustomHostnameAnalysisResultProperties object itself. + */ + public CustomHostnameAnalysisResultProperties withTxtRecords(List txtRecords) { + this.txtRecords = txtRecords; + return this; + } + + /** + * Get the aRecords property: A records visible for this hostname. + * + * @return the aRecords value. + */ + 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 CustomHostnameAnalysisResultProperties object itself. + */ + public CustomHostnameAnalysisResultProperties withARecords(List aRecords) { + this.aRecords = aRecords; + return this; + } + + /** + * Get the alternateCNameRecords property: Alternate CName records visible for this hostname. + * + * @return the alternateCNameRecords value. + */ + 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 CustomHostnameAnalysisResultProperties object itself. + */ + public CustomHostnameAnalysisResultProperties withAlternateCNameRecords(List alternateCNameRecords) { + this.alternateCNameRecords = alternateCNameRecords; + return this; + } + + /** + * Get the alternateTxtRecords property: Alternate TXT records visible for this hostname. + * + * @return the alternateTxtRecords value. + */ + 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 CustomHostnameAnalysisResultProperties object itself. + */ + public CustomHostnameAnalysisResultProperties 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentInner.java new file mode 100644 index 0000000000000..144ed857eef73 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentInner.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr Component. */ +@Fluent +public final class DaprComponentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DaprComponentInner.class); + + /* + * Dapr Component resource specific properties + */ + @JsonProperty(value = "properties") + private DaprComponentProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Dapr Component resource specific properties. + * + * @return the innerProperties value. + */ + private DaprComponentProperties 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 componentType property: Component type. + * + * @return the componentType value. + */ + public String componentType() { + return this.innerProperties() == null ? null : this.innerProperties().componentType(); + } + + /** + * Set the componentType property: Component type. + * + * @param componentType the componentType value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withComponentType(String componentType) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withComponentType(componentType); + return this; + } + + /** + * Get the version property: Component version. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Set the version property: Component version. + * + * @param version the version value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withVersion(String version) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withVersion(version); + return this; + } + + /** + * Get the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @return the ignoreErrors value. + */ + public Boolean ignoreErrors() { + return this.innerProperties() == null ? null : this.innerProperties().ignoreErrors(); + } + + /** + * Set the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @param ignoreErrors the ignoreErrors value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withIgnoreErrors(Boolean ignoreErrors) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withIgnoreErrors(ignoreErrors); + return this; + } + + /** + * Get the initTimeout property: Initialization timeout. + * + * @return the initTimeout value. + */ + public String initTimeout() { + return this.innerProperties() == null ? null : this.innerProperties().initTimeout(); + } + + /** + * Set the initTimeout property: Initialization timeout. + * + * @param initTimeout the initTimeout value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withInitTimeout(String initTimeout) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withInitTimeout(initTimeout); + return this; + } + + /** + * Get the secrets property: Collection of secrets used by a Dapr component. + * + * @return the secrets value. + */ + public List secrets() { + return this.innerProperties() == null ? null : this.innerProperties().secrets(); + } + + /** + * Set the secrets property: Collection of secrets used by a Dapr component. + * + * @param secrets the secrets value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withSecrets(List secrets) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withSecrets(secrets); + return this; + } + + /** + * Get the metadata property: Component metadata. + * + * @return the metadata value. + */ + public List metadata() { + return this.innerProperties() == null ? null : this.innerProperties().metadata(); + } + + /** + * Set the metadata property: Component metadata. + * + * @param metadata the metadata value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withMetadata(List metadata) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withMetadata(metadata); + return this; + } + + /** + * Get the scopes property: Names of container apps that can use this Dapr component. + * + * @return the scopes value. + */ + public List scopes() { + return this.innerProperties() == null ? null : this.innerProperties().scopes(); + } + + /** + * Set the scopes property: Names of container apps that can use this Dapr component. + * + * @param scopes the scopes value to set. + * @return the DaprComponentInner object itself. + */ + public DaprComponentInner withScopes(List scopes) { + if (this.innerProperties() == null) { + this.innerProperties = new DaprComponentProperties(); + } + this.innerProperties().withScopes(scopes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentProperties.java new file mode 100644 index 0000000000000..7919861cc27bd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentProperties.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr Component resource specific properties. */ +@Fluent +public final class DaprComponentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DaprComponentProperties.class); + + /* + * Component type + */ + @JsonProperty(value = "componentType") + private String componentType; + + /* + * Component version + */ + @JsonProperty(value = "version") + private String version; + + /* + * Boolean describing if the component errors are ignores + */ + @JsonProperty(value = "ignoreErrors") + private Boolean ignoreErrors; + + /* + * Initialization timeout + */ + @JsonProperty(value = "initTimeout") + private String initTimeout; + + /* + * Collection of secrets used by a Dapr component + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Component metadata + */ + @JsonProperty(value = "metadata") + private List metadata; + + /* + * Names of container apps that can use this Dapr component + */ + @JsonProperty(value = "scopes") + private List scopes; + + /** + * Get the componentType property: Component type. + * + * @return the componentType value. + */ + public String componentType() { + return this.componentType; + } + + /** + * Set the componentType property: Component type. + * + * @param componentType the componentType value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withComponentType(String componentType) { + this.componentType = componentType; + return this; + } + + /** + * Get the version property: Component version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Component version. + * + * @param version the version value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @return the ignoreErrors value. + */ + public Boolean ignoreErrors() { + return this.ignoreErrors; + } + + /** + * Set the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @param ignoreErrors the ignoreErrors value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withIgnoreErrors(Boolean ignoreErrors) { + this.ignoreErrors = ignoreErrors; + return this; + } + + /** + * Get the initTimeout property: Initialization timeout. + * + * @return the initTimeout value. + */ + public String initTimeout() { + return this.initTimeout; + } + + /** + * Set the initTimeout property: Initialization timeout. + * + * @param initTimeout the initTimeout value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withInitTimeout(String initTimeout) { + this.initTimeout = initTimeout; + return this; + } + + /** + * Get the secrets property: Collection of secrets used by a Dapr component. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Collection of secrets used by a Dapr component. + * + * @param secrets the secrets value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the metadata property: Component metadata. + * + * @return the metadata value. + */ + public List metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Component metadata. + * + * @param metadata the metadata value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the scopes property: Names of container apps that can use this Dapr component. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: Names of container apps that can use this Dapr component. + * + * @param scopes the scopes value to set. + * @return the DaprComponentProperties object itself. + */ + public DaprComponentProperties withScopes(List scopes) { + this.scopes = scopes; + 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 (metadata() != null) { + metadata().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java new file mode 100644 index 0000000000000..72551cc23177a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An environment for hosting container apps. */ +@Fluent +public final class ManagedEnvironmentInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentInner.class); + + /* + * Managed environment resource specific properties + */ + @JsonProperty(value = "properties") + private ManagedEnvironmentProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ManagedEnvironmentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedEnvironmentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Environment. + * + * @return the provisioningState value. + */ + public EnvironmentProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @return the daprAIInstrumentationKey value. + */ + public String daprAIInstrumentationKey() { + return this.innerProperties() == null ? null : this.innerProperties().daprAIInstrumentationKey(); + } + + /** + * Set the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @param daprAIInstrumentationKey the daprAIInstrumentationKey value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withDaprAIInstrumentationKey(daprAIInstrumentationKey); + return this; + } + + /** + * Get the vnetConfiguration property: Vnet configuration for the environment. + * + * @return the vnetConfiguration value. + */ + public VnetConfiguration vnetConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().vnetConfiguration(); + } + + /** + * Set the vnetConfiguration property: Vnet configuration for the environment. + * + * @param vnetConfiguration the vnetConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withVnetConfiguration(VnetConfiguration vnetConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withVnetConfiguration(vnetConfiguration); + return this; + } + + /** + * Get the deploymentErrors property: Any errors that occurred during deployment or deployment validation. + * + * @return the deploymentErrors value. + */ + public String deploymentErrors() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentErrors(); + } + + /** + * Get the defaultDomain property: Default Domain Name for the cluster. + * + * @return the defaultDomain value. + */ + public String defaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDomain(); + } + + /** + * Get the staticIp property: Static IP of the Environment. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.innerProperties() == null ? null : this.innerProperties().staticIp(); + } + + /** + * Get the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @return the appLogsConfiguration value. + */ + public AppLogsConfiguration appLogsConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().appLogsConfiguration(); + } + + /** + * Set the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @param appLogsConfiguration the appLogsConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withAppLogsConfiguration(appLogsConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java new file mode 100644 index 0000000000000..2f22feb920ad5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed environment resource specific properties. */ +@Fluent +public final class ManagedEnvironmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentProperties.class); + + /* + * Provisioning state of the Environment. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EnvironmentProvisioningState provisioningState; + + /* + * Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry + */ + @JsonProperty(value = "daprAIInstrumentationKey") + private String daprAIInstrumentationKey; + + /* + * Vnet configuration for the environment + */ + @JsonProperty(value = "vnetConfiguration") + private VnetConfiguration vnetConfiguration; + + /* + * Any errors that occurred during deployment or deployment validation + */ + @JsonProperty(value = "deploymentErrors", access = JsonProperty.Access.WRITE_ONLY) + private String deploymentErrors; + + /* + * Default Domain Name for the cluster + */ + @JsonProperty(value = "defaultDomain", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDomain; + + /* + * Static IP of the Environment + */ + @JsonProperty(value = "staticIp", access = JsonProperty.Access.WRITE_ONLY) + private String staticIp; + + /* + * Cluster configuration which enables the log daemon to export + * app logs to a destination. Currently only "log-analytics" is + * supported + */ + @JsonProperty(value = "appLogsConfiguration") + private AppLogsConfiguration appLogsConfiguration; + + /** + * Get the provisioningState property: Provisioning state of the Environment. + * + * @return the provisioningState value. + */ + public EnvironmentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @return the daprAIInstrumentationKey value. + */ + public String daprAIInstrumentationKey() { + return this.daprAIInstrumentationKey; + } + + /** + * Set the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @param daprAIInstrumentationKey the daprAIInstrumentationKey value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { + this.daprAIInstrumentationKey = daprAIInstrumentationKey; + return this; + } + + /** + * Get the vnetConfiguration property: Vnet configuration for the environment. + * + * @return the vnetConfiguration value. + */ + public VnetConfiguration vnetConfiguration() { + return this.vnetConfiguration; + } + + /** + * Set the vnetConfiguration property: Vnet configuration for the environment. + * + * @param vnetConfiguration the vnetConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withVnetConfiguration(VnetConfiguration vnetConfiguration) { + this.vnetConfiguration = vnetConfiguration; + return this; + } + + /** + * Get the deploymentErrors property: Any errors that occurred during deployment or deployment validation. + * + * @return the deploymentErrors value. + */ + public String deploymentErrors() { + return this.deploymentErrors; + } + + /** + * Get the defaultDomain property: Default Domain Name for the cluster. + * + * @return the defaultDomain value. + */ + public String defaultDomain() { + return this.defaultDomain; + } + + /** + * Get the staticIp property: Static IP of the Environment. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.staticIp; + } + + /** + * Get the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @return the appLogsConfiguration value. + */ + public AppLogsConfiguration appLogsConfiguration() { + return this.appLogsConfiguration; + } + + /** + * Set the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @param appLogsConfiguration the appLogsConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration) { + this.appLogsConfiguration = appLogsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vnetConfiguration() != null) { + vnetConfiguration().validate(); + } + if (appLogsConfiguration() != null) { + appLogsConfiguration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java new file mode 100644 index 0000000000000..f7cc683fe121c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage resource for managedEnvironment. */ +@Fluent +public final class ManagedEnvironmentStorageInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentStorageInner.class); + + /* + * Storage properties + */ + @JsonProperty(value = "properties") + private ManagedEnvironmentStorageProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Storage properties. + * + * @return the properties value. + */ + public ManagedEnvironmentStorageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Storage properties. + * + * @param properties the properties value to set. + * @return the ManagedEnvironmentStorageInner object itself. + */ + public ManagedEnvironmentStorageInner withProperties(ManagedEnvironmentStorageProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.java new file mode 100644 index 0000000000000..7e52342032ba9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Storage for Environments. */ +@Fluent +public final class ManagedEnvironmentStoragesCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentStoragesCollectionInner.class); + + /* + * Collection of storage resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Collection of storage resources. + * + * @return the value value. + */ + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ManagedEnvironmentStoragesCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java new file mode 100644 index 0000000000000..528834c8d3f28 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation detail payload. */ +@Fluent +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); + + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java new file mode 100644 index 0000000000000..d4efb016525e7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Revision Replicas collection ARM resource. */ +@Fluent +public final class ReplicaCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaCollectionInner.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ReplicaCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java new file mode 100644 index 0000000000000..4c00b134ad355 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Container App Revision Replica. */ +@Fluent +public final class ReplicaInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaInner.class); + + /* + * Replica resource specific properties + */ + @JsonProperty(value = "properties") + private ReplicaProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Replica resource specific properties. + * + * @return the innerProperties value. + */ + private ReplicaProperties 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 createdTime property: Timestamp describing when the pod was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); + } + + /** + * Get the containers property: The containers collection under a replica. + * + * @return the containers value. + */ + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java new file mode 100644 index 0000000000000..f7476a9d559c3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Replica resource specific properties. */ +@Fluent +public final class ReplicaProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaProperties.class); + + /* + * Timestamp describing when the pod was created by controller + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * The containers collection under a replica. + */ + @JsonProperty(value = "containers") + private List containers; + + /** + * Get the createdTime property: Timestamp describing when the pod was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the containers property: The containers collection under a replica. + * + * @return the containers value. + */ + public List 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java new file mode 100644 index 0000000000000..4c1f08403d6f8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Container App Revision. */ +@Fluent +public final class RevisionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RevisionInner.class); + + /* + * Revision resource specific properties + */ + @JsonProperty(value = "properties") + private RevisionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Revision resource specific properties. + * + * @return the innerProperties value. + */ + private RevisionProperties 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 createdTime property: Timestamp describing when the revision was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); + } + + /** + * Get the fqdn property: Fully qualified domain name of the revision. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the template property: Container App Revision Template with all possible settings and the defaults if user + * did not provide them. The defaults are populated as they were at the creation time. + * + * @return the template value. + */ + public Template template() { + return this.innerProperties() == null ? null : this.innerProperties().template(); + } + + /** + * Get the active property: Boolean describing if the Revision is Active. + * + * @return the active value. + */ + public Boolean active() { + return this.innerProperties() == null ? null : this.innerProperties().active(); + } + + /** + * Get the replicas property: Number of pods currently running for this revision. + * + * @return the replicas value. + */ + public Integer replicas() { + return this.innerProperties() == null ? null : this.innerProperties().replicas(); + } + + /** + * Get the trafficWeight property: Traffic weight assigned to this revision. + * + * @return the trafficWeight value. + */ + public Integer trafficWeight() { + return this.innerProperties() == null ? null : this.innerProperties().trafficWeight(); + } + + /** + * Get the provisioningError property: Optional Field - Platform Error Message. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningError(); + } + + /** + * Get the healthState property: Current health State of the revision. + * + * @return the healthState value. + */ + public RevisionHealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Get the provisioningState property: Current provisioning State of the revision. + * + * @return the provisioningState value. + */ + public RevisionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java new file mode 100644 index 0000000000000..4104d599a8135 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Revision resource specific properties. */ +@Immutable +public final class RevisionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RevisionProperties.class); + + /* + * Timestamp describing when the revision was created + * by controller + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Fully qualified domain name of the revision + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated + * as they were at the creation time + */ + @JsonProperty(value = "template", access = JsonProperty.Access.WRITE_ONLY) + private Template template; + + /* + * Boolean describing if the Revision is Active + */ + @JsonProperty(value = "active", access = JsonProperty.Access.WRITE_ONLY) + private Boolean active; + + /* + * Number of pods currently running for this revision + */ + @JsonProperty(value = "replicas", access = JsonProperty.Access.WRITE_ONLY) + private Integer replicas; + + /* + * Traffic weight assigned to this revision + */ + @JsonProperty(value = "trafficWeight", access = JsonProperty.Access.WRITE_ONLY) + private Integer trafficWeight; + + /* + * Optional Field - Platform Error Message + */ + @JsonProperty(value = "provisioningError", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningError; + + /* + * Current health State of the revision + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private RevisionHealthState healthState; + + /* + * Current provisioning State of the revision + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private RevisionProvisioningState provisioningState; + + /** + * Get the createdTime property: Timestamp describing when the revision was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the fqdn property: Fully qualified domain name of the revision. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the template property: Container App Revision Template with all possible settings and the defaults if user + * did not provide them. The defaults are populated as they were at the creation time. + * + * @return the template value. + */ + public Template template() { + return this.template; + } + + /** + * Get the active property: Boolean describing if the Revision is Active. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Get the replicas property: Number of pods currently running for this revision. + * + * @return the replicas value. + */ + public Integer replicas() { + return this.replicas; + } + + /** + * Get the trafficWeight property: Traffic weight assigned to this revision. + * + * @return the trafficWeight value. + */ + public Integer trafficWeight() { + return this.trafficWeight; + } + + /** + * Get the provisioningError property: Optional Field - Platform Error Message. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.provisioningError; + } + + /** + * Get the healthState property: Current health State of the revision. + * + * @return the healthState value. + */ + public RevisionHealthState healthState() { + return this.healthState; + } + + /** + * Get the provisioningState property: Current provisioning State of the revision. + * + * @return the provisioningState value. + */ + public RevisionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (template() != null) { + template().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SecretsCollectionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SecretsCollectionInner.java new file mode 100644 index 0000000000000..09f2740e0378a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SecretsCollectionInner.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ContainerAppSecret; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Secrets Collection ARM resource. */ +@Fluent +public final class SecretsCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretsCollectionInner.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the 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 + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SecretsCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java new file mode 100644 index 0000000000000..ad260d3b45003 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControlOperationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App SourceControl. */ +@Fluent +public final class SourceControlInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlInner.class); + + /* + * SourceControl resource specific properties + */ + @JsonProperty(value = "properties") + private SourceControlProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: SourceControl resource specific properties. + * + * @return the innerProperties value. + */ + private SourceControlProperties 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 operationState property: Current provisioning State of the operation. + * + * @return the operationState value. + */ + public SourceControlOperationState operationState() { + return this.innerProperties() == null ? null : this.innerProperties().operationState(); + } + + /** + * Get the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @return the repoUrl value. + */ + public String repoUrl() { + return this.innerProperties() == null ? null : this.innerProperties().repoUrl(); + } + + /** + * Set the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @param repoUrl the repoUrl value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withRepoUrl(String repoUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withRepoUrl(repoUrl); + return this; + } + + /** + * Get the branch property: The branch which will trigger the auto deployment. + * + * @return the branch value. + */ + public String branch() { + return this.innerProperties() == null ? null : this.innerProperties().branch(); + } + + /** + * Set the branch property: The branch which will trigger the auto deployment. + * + * @param branch the branch value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withBranch(String branch) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withBranch(branch); + return this; + } + + /** + * Get the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @return the githubActionConfiguration value. + */ + public GithubActionConfiguration githubActionConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().githubActionConfiguration(); + } + + /** + * Set the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @param githubActionConfiguration the githubActionConfiguration value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withGithubActionConfiguration(githubActionConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java new file mode 100644 index 0000000000000..1a31ce880c1b4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControlOperationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SourceControl resource specific properties. */ +@Fluent +public final class SourceControlProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlProperties.class); + + /* + * Current provisioning State of the operation + */ + @JsonProperty(value = "operationState", access = JsonProperty.Access.WRITE_ONLY) + private SourceControlOperationState operationState; + + /* + * The repo url which will be integrated to ContainerApp. + */ + @JsonProperty(value = "repoUrl") + private String repoUrl; + + /* + * The branch which will trigger the auto deployment + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated + * as they were at the creation time + */ + @JsonProperty(value = "githubActionConfiguration") + private GithubActionConfiguration githubActionConfiguration; + + /** + * Get the operationState property: Current provisioning State of the operation. + * + * @return the operationState value. + */ + public SourceControlOperationState operationState() { + return this.operationState; + } + + /** + * Get the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @return the repoUrl value. + */ + public String repoUrl() { + return this.repoUrl; + } + + /** + * Set the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @param repoUrl the repoUrl value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withRepoUrl(String repoUrl) { + this.repoUrl = repoUrl; + return this; + } + + /** + * Get the branch property: The branch which will trigger the auto deployment. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The branch which will trigger the auto deployment. + * + * @param branch the branch value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @return the githubActionConfiguration value. + */ + public GithubActionConfiguration githubActionConfiguration() { + return this.githubActionConfiguration; + } + + /** + * Set the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @param githubActionConfiguration the githubActionConfiguration value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration) { + this.githubActionConfiguration = githubActionConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (githubActionConfiguration() != null) { + githubActionConfiguration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java new file mode 100644 index 0000000000000..1d8bdaca7da83 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.fluent.models; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java new file mode 100644 index 0000000000000..4cc51edd8bae0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.fluent; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/AuthConfigImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/AuthConfigImpl.java new file mode 100644 index 0000000000000..b51c68e3036ba --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/AuthConfigImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.AuthConfigInner; +import com.azure.resourcemanager.app.models.AuthConfig; +import com.azure.resourcemanager.app.models.EasyAuthState; +import com.azure.resourcemanager.app.models.GlobalValidation; +import com.azure.resourcemanager.app.models.HttpSettings; +import com.azure.resourcemanager.app.models.IdentityProviders; +import com.azure.resourcemanager.app.models.Login; + +public final class AuthConfigImpl implements AuthConfig, AuthConfig.Definition, AuthConfig.Update { + private AuthConfigInner innerObject; + + private final com.azure.resourcemanager.app.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 EasyAuthState state() { + return this.innerModel().state(); + } + + public GlobalValidation globalValidation() { + return this.innerModel().globalValidation(); + } + + public IdentityProviders identityProviders() { + return this.innerModel().identityProviders(); + } + + public Login login() { + return this.innerModel().login(); + } + + public HttpSettings httpSettings() { + return this.innerModel().httpSettings(); + } + + public AuthConfigInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerAppName; + + private String name; + + public AuthConfigImpl withExistingContainerApp(String resourceGroupName, String containerAppName) { + this.resourceGroupName = resourceGroupName; + this.containerAppName = containerAppName; + return this; + } + + public AuthConfig create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsAuthConfigs() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AuthConfig create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsAuthConfigs() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, name, this.innerModel(), context) + .getValue(); + return this; + } + + AuthConfigImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new AuthConfigInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AuthConfigImpl update() { + return this; + } + + public AuthConfig apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsAuthConfigs() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AuthConfig apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsAuthConfigs() + .createOrUpdateWithResponse(resourceGroupName, containerAppName, name, this.innerModel(), context) + .getValue(); + return this; + } + + AuthConfigImpl(AuthConfigInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerAppName = Utils.getValueFromIdByName(innerObject.id(), "containerApps"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "authConfigs"); + } + + public AuthConfig refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsAuthConfigs() + .getWithResponse(resourceGroupName, containerAppName, name, Context.NONE) + .getValue(); + return this; + } + + public AuthConfig refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsAuthConfigs() + .getWithResponse(resourceGroupName, containerAppName, name, context) + .getValue(); + return this; + } + + public AuthConfigImpl withState(EasyAuthState state) { + this.innerModel().withState(state); + return this; + } + + public AuthConfigImpl withGlobalValidation(GlobalValidation globalValidation) { + this.innerModel().withGlobalValidation(globalValidation); + return this; + } + + public AuthConfigImpl withIdentityProviders(IdentityProviders identityProviders) { + this.innerModel().withIdentityProviders(identityProviders); + return this; + } + + public AuthConfigImpl withLogin(Login login) { + this.innerModel().withLogin(login); + return this; + } + + public AuthConfigImpl withHttpSettings(HttpSettings httpSettings) { + this.innerModel().withHttpSettings(httpSettings); + return this; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificateImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificateImpl.java new file mode 100644 index 0000000000000..65c7a0f9c3a92 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificateImpl.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.CertificateInner; +import com.azure.resourcemanager.app.models.Certificate; +import com.azure.resourcemanager.app.models.CertificatePatch; +import com.azure.resourcemanager.app.models.CertificateProperties; +import java.util.Collections; +import java.util.Map; + +public final class CertificateImpl implements Certificate, Certificate.Definition, Certificate.Update { + private CertificateInner innerObject; + + private final com.azure.resourcemanager.app.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 CertificateProperties 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 CertificateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String managedEnvironmentName; + + private String name; + + private CertificatePatch updateCertificateEnvelope; + + public CertificateImpl withExistingManagedEnvironment(String resourceGroupName, String managedEnvironmentName) { + this.resourceGroupName = resourceGroupName; + this.managedEnvironmentName = managedEnvironmentName; + return this; + } + + public Certificate create() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdateWithResponse( + resourceGroupName, managedEnvironmentName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Certificate create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdateWithResponse(resourceGroupName, managedEnvironmentName, name, this.innerModel(), context) + .getValue(); + return this; + } + + CertificateImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new CertificateInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public CertificateImpl update() { + this.updateCertificateEnvelope = new CertificatePatch(); + return this; + } + + public Certificate apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .updateWithResponse( + resourceGroupName, managedEnvironmentName, name, updateCertificateEnvelope, Context.NONE) + .getValue(); + return this; + } + + public Certificate apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .updateWithResponse(resourceGroupName, managedEnvironmentName, name, updateCertificateEnvelope, context) + .getValue(); + return this; + } + + CertificateImpl( + CertificateInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.managedEnvironmentName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "certificates"); + } + + public Certificate refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, managedEnvironmentName, name, Context.NONE) + .getValue(); + return this; + } + + public Certificate refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, managedEnvironmentName, name, context) + .getValue(); + return this; + } + + public CertificateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CertificateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CertificateImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateCertificateEnvelope.withTags(tags); + return this; + } + } + + public CertificateImpl withProperties(CertificateProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesClientImpl.java new file mode 100644 index 0000000000000..9dda7c57dea2b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesClientImpl.java @@ -0,0 +1,1160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.CertificatesClient; +import com.azure.resourcemanager.app.fluent.models.CertificateInner; +import com.azure.resourcemanager.app.models.CertificateCollection; +import com.azure.resourcemanager.app.models.CertificatePatch; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public final class CertificatesClientImpl implements CertificatesClient { + private final ClientLogger logger = new ClientLogger(CertificatesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final CertificatesService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of CertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CertificatesClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientCertificates to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface CertificatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{managedEnvironmentName}/certificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedEnvironmentName") String managedEnvironmentName, + @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/{managedEnvironmentName}/certificates/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedEnvironmentName") String managedEnvironmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{managedEnvironmentName}/certificates/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedEnvironmentName") String managedEnvironmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CertificateInner certificateEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{managedEnvironmentName}/certificates/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedEnvironmentName") String managedEnvironmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{managedEnvironmentName}/certificates/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedEnvironmentName") String managedEnvironmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CertificatePatch certificateEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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 along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String managedEnvironmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + 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 managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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 Certificates in a given managed environment along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String managedEnvironmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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 managedEnvironmentName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, managedEnvironmentName), + 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 managedEnvironmentName 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 Certificates in a given managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String managedEnvironmentName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, managedEnvironmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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 managedEnvironmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, managedEnvironmentName)); + } + + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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 Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String managedEnvironmentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, managedEnvironmentName, context)); + } + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String managedEnvironmentName, 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 (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName 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, + managedEnvironmentName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String managedEnvironmentName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String managedEnvironmentName, String name) { + return getWithResponseAsync(resourceGroupName, managedEnvironmentName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateInner get(String resourceGroupName, String managedEnvironmentName, String name) { + return getAsync(resourceGroupName, managedEnvironmentName, name).block(); + } + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Certificate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String managedEnvironmentName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, managedEnvironmentName, name, context).block(); + } + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, String name, 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 (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + managedEnvironmentName, + name, + this.client.getApiVersion(), + certificateEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, + String name, + CertificateInner certificateEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (certificateEnvelope != null) { + certificateEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + name, + this.client.getApiVersion(), + certificateEnvelope, + accept, + context); + } + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, String name, CertificateInner certificateEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, managedEnvironmentName, name, certificateEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 managedEnvironmentName, String name) { + final CertificateInner certificateEnvelope = null; + return createOrUpdateWithResponseAsync(resourceGroupName, managedEnvironmentName, name, certificateEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 managedEnvironmentName, String name) { + final CertificateInner certificateEnvelope = null; + return createOrUpdateAsync(resourceGroupName, managedEnvironmentName, name, certificateEnvelope).block(); + } + + /** + * Create or Update a Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, + String name, + CertificateInner certificateEnvelope, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, managedEnvironmentName, name, certificateEnvelope, context) + .block(); + } + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 managedEnvironmentName, 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 (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName 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, + managedEnvironmentName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 managedEnvironmentName, String name) { + return deleteWithResponseAsync(resourceGroupName, managedEnvironmentName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 managedEnvironmentName, String name) { + deleteAsync(resourceGroupName, managedEnvironmentName, name).block(); + } + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, managedEnvironmentName, name, context).block(); + } + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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> updateWithResponseAsync( + String resourceGroupName, String managedEnvironmentName, String name, 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 (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + name, + this.client.getApiVersion(), + certificateEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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> updateWithResponseAsync( + String resourceGroupName, + String managedEnvironmentName, + String name, + CertificatePatch certificateEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + name, + this.client.getApiVersion(), + certificateEnvelope, + accept, + context); + } + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 updateAsync( + String resourceGroupName, String managedEnvironmentName, String name, CertificatePatch certificateEnvelope) { + return updateWithResponseAsync(resourceGroupName, managedEnvironmentName, name, certificateEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 managedEnvironmentName, String name, CertificatePatch certificateEnvelope) { + return updateAsync(resourceGroupName, managedEnvironmentName, name, certificateEnvelope).block(); + } + + /** + * Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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 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 updateWithResponse( + String resourceGroupName, + String managedEnvironmentName, + String name, + CertificatePatch certificateEnvelope, + Context context) { + return updateWithResponseAsync(resourceGroupName, managedEnvironmentName, name, certificateEnvelope, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Certificates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 Certificates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesImpl.java new file mode 100644 index 0000000000000..8c44f60e2f6db --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesImpl.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.CertificatesClient; +import com.azure.resourcemanager.app.fluent.models.CertificateInner; +import com.azure.resourcemanager.app.models.Certificate; +import com.azure.resourcemanager.app.models.Certificates; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CertificatesImpl implements Certificates { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatesImpl.class); + + private final CertificatesClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public CertificatesImpl( + CertificatesClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String managedEnvironmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, managedEnvironmentName); + return Utils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String managedEnvironmentName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, managedEnvironmentName, context); + return Utils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + } + + public Certificate get(String resourceGroupName, String managedEnvironmentName, String name) { + CertificateInner inner = this.serviceClient().get(resourceGroupName, managedEnvironmentName, name); + if (inner != null) { + return new CertificateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String managedEnvironmentName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, managedEnvironmentName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String managedEnvironmentName, String name) { + this.serviceClient().delete(resourceGroupName, managedEnvironmentName, name); + } + + public Response deleteWithResponse( + String resourceGroupName, String managedEnvironmentName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, managedEnvironmentName, name, context); + } + + public Certificate getById(String id) { + String resourceGroupName = Utils.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 managedEnvironmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (managedEnvironmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "certificates"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, managedEnvironmentName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 managedEnvironmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (managedEnvironmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "certificates"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, managedEnvironmentName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 managedEnvironmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (managedEnvironmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "certificates"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + this.deleteWithResponse(resourceGroupName, managedEnvironmentName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 managedEnvironmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (managedEnvironmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "certificates"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, managedEnvironmentName, name, context); + } + + private CertificatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public CertificateImpl define(String name) { + return new CertificateImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java new file mode 100644 index 0000000000000..e32161fb569da --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.ContainerApp; +import com.azure.resourcemanager.app.models.ContainerAppPatch; +import com.azure.resourcemanager.app.models.ContainerAppProvisioningState; +import com.azure.resourcemanager.app.models.ManagedServiceIdentity; +import com.azure.resourcemanager.app.models.SecretsCollection; +import com.azure.resourcemanager.app.models.Template; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ContainerAppImpl implements ContainerApp, ContainerApp.Definition, ContainerApp.Update { + private ContainerAppInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public ContainerAppProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String managedEnvironmentId() { + return this.innerModel().managedEnvironmentId(); + } + + public String latestRevisionName() { + return this.innerModel().latestRevisionName(); + } + + public String latestRevisionFqdn() { + return this.innerModel().latestRevisionFqdn(); + } + + public String customDomainVerificationId() { + return this.innerModel().customDomainVerificationId(); + } + + public Configuration configuration() { + return this.innerModel().configuration(); + } + + public Template template() { + return this.innerModel().template(); + } + + public List outboundIpAddresses() { + List inner = this.innerModel().outboundIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ContainerAppInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ContainerAppPatch updateContainerAppEnvelope; + + public ContainerAppImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContainerApp create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ContainerApp create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ContainerAppImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new ContainerAppInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ContainerAppImpl update() { + this.updateContainerAppEnvelope = new ContainerAppPatch(); + return this; + } + + public ContainerApp apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .updateWithResponse(resourceGroupName, name, updateContainerAppEnvelope, Context.NONE) + .getValue(); + return this; + } + + public ContainerApp apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .updateWithResponse(resourceGroupName, name, updateContainerAppEnvelope, context) + .getValue(); + return this; + } + + ContainerAppImpl( + ContainerAppInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "containerApps"); + } + + public ContainerApp refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ContainerApp refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public SecretsCollection listSecrets() { + return serviceManager.containerApps().listSecrets(resourceGroupName, name); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager.containerApps().listSecretsWithResponse(resourceGroupName, name, context); + } + + public ContainerAppImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContainerAppImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContainerAppImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateContainerAppEnvelope.withTags(tags); + return this; + } + } + + public ContainerAppImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public ContainerAppImpl withManagedEnvironmentId(String managedEnvironmentId) { + this.innerModel().withManagedEnvironmentId(managedEnvironmentId); + return this; + } + + public ContainerAppImpl withConfiguration(Configuration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public ContainerAppImpl withTemplate(Template template) { + this.innerModel().withTemplate(template); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java new file mode 100644 index 0000000000000..a4a09a0a24dc7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ContainerAppsApiClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ContainerAppsApiClientImpl.class}) +public final class ContainerAppsApiClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerAppsApiClientImpl with the provided parameters. + * + * @return an instance of ContainerAppsApiClientImpl. + */ + public ContainerAppsApiClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ContainerAppsApiClientImpl client = + new ContainerAppsApiClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java new file mode 100644 index 0000000000000..5b99cfbc46268 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.app.fluent.CertificatesClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsApiClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsAuthConfigsClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionReplicasClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.app.fluent.DaprComponentsClient; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.app.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ContainerAppsApiClientImpl type. */ +@ServiceClient(builder = ContainerAppsApiClientBuilder.class) +public final class ContainerAppsApiClientImpl implements ContainerAppsApiClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsApiClientImpl.class); + + /** 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. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ContainerAppsClient object to access its operations. */ + private final ContainerAppsClient containerApps; + + /** + * Gets the ContainerAppsClient object to access its operations. + * + * @return the ContainerAppsClient object. + */ + public ContainerAppsClient getContainerApps() { + return this.containerApps; + } + + /** The ContainerAppsRevisionsClient object to access its operations. */ + private final ContainerAppsRevisionsClient containerAppsRevisions; + + /** + * Gets the ContainerAppsRevisionsClient object to access its operations. + * + * @return the ContainerAppsRevisionsClient object. + */ + public ContainerAppsRevisionsClient getContainerAppsRevisions() { + return this.containerAppsRevisions; + } + + /** The ContainerAppsRevisionReplicasClient object to access its operations. */ + private final ContainerAppsRevisionReplicasClient containerAppsRevisionReplicas; + + /** + * Gets the ContainerAppsRevisionReplicasClient object to access its operations. + * + * @return the ContainerAppsRevisionReplicasClient object. + */ + public ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas() { + return this.containerAppsRevisionReplicas; + } + + /** The ManagedEnvironmentsClient object to access its operations. */ + private final ManagedEnvironmentsClient managedEnvironments; + + /** + * Gets the ManagedEnvironmentsClient object to access its operations. + * + * @return the ManagedEnvironmentsClient object. + */ + public ManagedEnvironmentsClient getManagedEnvironments() { + return this.managedEnvironments; + } + + /** The CertificatesClient object to access its operations. */ + private final CertificatesClient certificates; + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + public CertificatesClient getCertificates() { + return this.certificates; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The ContainerAppsSourceControlsClient object to access its operations. */ + private final ContainerAppsSourceControlsClient containerAppsSourceControls; + + /** + * Gets the ContainerAppsSourceControlsClient object to access its operations. + * + * @return the ContainerAppsSourceControlsClient object. + */ + public ContainerAppsSourceControlsClient getContainerAppsSourceControls() { + return this.containerAppsSourceControls; + } + + /** 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 ContainerAppsAuthConfigsClient object to access its operations. */ + private final ContainerAppsAuthConfigsClient containerAppsAuthConfigs; + + /** + * Gets the ContainerAppsAuthConfigsClient object to access its operations. + * + * @return the ContainerAppsAuthConfigsClient object. + */ + public ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs() { + return this.containerAppsAuthConfigs; + } + + /** 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; + } + + /** + * Initializes an instance of ContainerAppsApiClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @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. + */ + ContainerAppsApiClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-01-01-preview"; + this.containerApps = new ContainerAppsClientImpl(this); + this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); + this.containerAppsRevisionReplicas = new ContainerAppsRevisionReplicasClientImpl(this); + this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); + this.certificates = new CertificatesClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); + this.daprComponents = new DaprComponentsClientImpl(this); + this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); + this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsClientImpl.java new file mode 100644 index 0000000000000..fe623d6add931 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsClientImpl.java @@ -0,0 +1,917 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsAuthConfigsClient; +import com.azure.resourcemanager.app.fluent.models.AuthConfigInner; +import com.azure.resourcemanager.app.models.AuthConfigCollection; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsAuthConfigsClient. */ +public final class ContainerAppsAuthConfigsClientImpl implements ContainerAppsAuthConfigsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsAuthConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsAuthConfigsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsAuthConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsAuthConfigsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create(ContainerAppsAuthConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsAuthConfigs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsAuthConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/authConfigs") + @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}/authConfigs/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/authConfigs/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @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/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByContainerAppNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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. + * @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} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync( + String resourceGroupName, String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .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)); + } + + /** + * 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. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync( + String resourceGroupName, String containerAppName, Context context) { + return new PagedFlux<>( + () -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink, 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, 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 DefaultErrorResponseErrorException 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<>(listByContainerAppAsync(resourceGroupName, containerAppName, context)); + } + + /** + * 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 name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String containerAppName, 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name Name of the Container App AuthConfig. + * @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 AuthConfig of 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 name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, String name) { + return getWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthConfigInner get(String resourceGroupName, String containerAppName, String name) { + return getAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * 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 name Name of the Container App AuthConfig. + * @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 AuthConfig of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerAppName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + authConfigEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String containerAppName, + String name, + AuthConfigInner authConfigEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + authConfigEnvelope, + accept, + context); + } + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerAppName, String name, AuthConfigInner authConfigEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, name, authConfigEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AuthConfigInner createOrUpdate( + String resourceGroupName, String containerAppName, String name, AuthConfigInner authConfigEnvelope) { + return createOrUpdateAsync(resourceGroupName, containerAppName, name, authConfigEnvelope).block(); + } + + /** + * Description for Create or update the AuthConfig 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 name Name of the Container App AuthConfig. + * @param authConfigEnvelope Properties used to create a Container App AuthConfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration settings for the Azure ContainerApp Authentication / Authorization feature along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String containerAppName, + String name, + AuthConfigInner authConfigEnvelope, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, name, authConfigEnvelope, context) + .block(); + } + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String name) { + return deleteWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String name) { + deleteAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return authConfig collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 authConfig collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsImpl.java new file mode 100644 index 0000000000000..db424173b47ae --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsImpl.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsAuthConfigsClient; +import com.azure.resourcemanager.app.fluent.models.AuthConfigInner; +import com.azure.resourcemanager.app.models.AuthConfig; +import com.azure.resourcemanager.app.models.ContainerAppsAuthConfigs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsAuthConfigsImpl implements ContainerAppsAuthConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsAuthConfigsImpl.class); + + private final ContainerAppsAuthConfigsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsAuthConfigsImpl( + ContainerAppsAuthConfigsClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + PagedIterable inner = + this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return Utils.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 Utils.mapPage(inner, inner1 -> new AuthConfigImpl(inner1, this.manager())); + } + + public AuthConfig get(String resourceGroupName, String containerAppName, String name) { + AuthConfigInner inner = this.serviceClient().get(resourceGroupName, containerAppName, name); + if (inner != null) { + return new AuthConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, containerAppName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AuthConfigImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().delete(resourceGroupName, containerAppName, name); + } + + public Response deleteWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, containerAppName, name, context); + } + + public AuthConfig getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "authConfigs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'authConfigs'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "authConfigs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'authConfigs'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "authConfigs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'authConfigs'.", id))); + } + this.deleteWithResponse(resourceGroupName, containerAppName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "authConfigs"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'authConfigs'.", id))); + } + return this.deleteWithResponse(resourceGroupName, containerAppName, name, context); + } + + private ContainerAppsAuthConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public AuthConfigImpl define(String name) { + return new AuthConfigImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java new file mode 100644 index 0000000000000..98be780cf5504 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java @@ -0,0 +1,1817 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.app.fluent.ContainerAppsClient; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.fluent.models.CustomHostnameAnalysisResultInner; +import com.azure.resourcemanager.app.fluent.models.SecretsCollectionInner; +import com.azure.resourcemanager.app.models.ContainerAppCollection; +import com.azure.resourcemanager.app.models.ContainerAppPatch; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +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 ContainerAppsClient. */ +public final class ContainerAppsClientImpl implements ContainerAppsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(ContainerAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerApps to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps") + @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/containerApps" + + "/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerAppInner containerAppEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerAppPatch containerAppEnvelope, + @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(DefaultErrorResponseErrorException.class) + Mono> listCustomHostnameAnalysis( + @HostParam("$host") String endpoint, + @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); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}/listSecrets") + @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("name") String name, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Container Apps 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 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 Container Apps 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 in a given subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Container Apps 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 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 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 in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Container Apps 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 in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the Container Apps 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 in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the 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 DefaultErrorResponseErrorException 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}. + */ + @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 Container Apps in a given 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 the Container Apps in a given resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the 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 DefaultErrorResponseErrorException 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 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 in a given resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the 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 DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get the Container Apps in a given 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 the Container Apps in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, 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 (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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupAsync(resourceGroupName, name).block(); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a 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 {@link PollerFlux} for polling of container App. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, containerAppEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerAppInner.class, + ContainerAppInner.class, + this.client.getContext()); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 DefaultErrorResponseErrorException thrown 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 name, ContainerAppInner containerAppEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, containerAppEnvelope, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerAppInner.class, ContainerAppInner.class, context); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a 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 {@link SyncPoller} for polling of container App. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppInner> beginCreateOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope).getSyncPoller(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 DefaultErrorResponseErrorException thrown 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, String name, ContainerAppInner containerAppEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope, context).getSyncPoller(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner createOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return createOrUpdateAsync(resourceGroupName, name, containerAppEnvelope).block(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner createOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, name, containerAppEnvelope, context).block(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, 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 (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, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String name, ContainerAppPatch 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope) { + return updateWithResponseAsync(resourceGroupName, name, containerAppEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner update(String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope) { + return updateAsync(resourceGroupName, name, containerAppEnvelope).block(); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope, Context context) { + return updateWithResponseAsync(resourceGroupName, name, containerAppEnvelope, context).block(); + } + + /** + * Analyzes a custom hostname 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 customHostname Custom hostname. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain analysis along with {@link Response} on successful completion of {@link Mono}. + */ + @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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Analyzes a custom hostname 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 customHostname Custom hostname. + * @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 custom domain analysis along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCustomHostnameAnalysisWithResponseAsync( + String resourceGroupName, String containerAppName, String customHostname, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCustomHostnameAnalysis( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + customHostname, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Analyzes a custom hostname 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 customHostname Custom hostname. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain analysis on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCustomHostnameAnalysisAsync( + String resourceGroupName, String containerAppName, String customHostname) { + return listCustomHostnameAnalysisWithResponseAsync(resourceGroupName, containerAppName, customHostname) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Analyzes a custom hostname 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 custom domain analysis on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listCustomHostnameAnalysisAsync( + String resourceGroupName, String containerAppName) { + final String customHostname = null; + return listCustomHostnameAnalysisWithResponseAsync(resourceGroupName, containerAppName, customHostname) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Analyzes a custom hostname 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 custom domain analysis. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomHostnameAnalysisResultInner listCustomHostnameAnalysis( + String resourceGroupName, String containerAppName) { + final String customHostname = null; + return listCustomHostnameAnalysisAsync(resourceGroupName, containerAppName, customHostname).block(); + } + + /** + * Analyzes a custom hostname 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 customHostname Custom hostname. + * @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 custom domain analysis along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listCustomHostnameAnalysisWithResponse( + String resourceGroupName, String containerAppName, String customHostname, Context context) { + return listCustomHostnameAnalysisWithResponseAsync(resourceGroupName, containerAppName, customHostname, context) + .block(); + } + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 Secrets Collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync(String resourceGroupName, 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 (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 + .listSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + name, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 Secrets Collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + name, + accept, + context); + } + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 Secrets Collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync(String resourceGroupName, String name) { + return listSecretsWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretsCollectionInner listSecrets(String resourceGroupName, String name) { + return listSecretsAsync(resourceGroupName, name).block(); + } + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String name, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java new file mode 100644 index 0000000000000..32a456b0ea175 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsClient; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.fluent.models.CustomHostnameAnalysisResultInner; +import com.azure.resourcemanager.app.fluent.models.SecretsCollectionInner; +import com.azure.resourcemanager.app.models.ContainerApp; +import com.azure.resourcemanager.app.models.ContainerApps; +import com.azure.resourcemanager.app.models.CustomHostnameAnalysisResult; +import com.azure.resourcemanager.app.models.SecretsCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsImpl implements ContainerApps { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsImpl.class); + + private final ContainerAppsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsImpl( + ContainerAppsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public ContainerApp getByResourceGroup(String resourceGroupName, String name) { + ContainerAppInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ContainerAppImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerAppImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public CustomHostnameAnalysisResult listCustomHostnameAnalysis(String resourceGroupName, String containerAppName) { + CustomHostnameAnalysisResultInner inner = + this.serviceClient().listCustomHostnameAnalysis(resourceGroupName, containerAppName); + if (inner != null) { + return new CustomHostnameAnalysisResultImpl(inner, this.manager()); + } else { + return null; + } + } + + 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; + } + } + + public SecretsCollection listSecrets(String resourceGroupName, String name) { + SecretsCollectionInner inner = this.serviceClient().listSecrets(resourceGroupName, name); + if (inner != null) { + return new SecretsCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse(String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SecretsCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerApp getById(String id) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ContainerAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ContainerAppImpl define(String name) { + return new ContainerAppImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java new file mode 100644 index 0000000000000..455a601e67cd9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.Response; +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.app.fluent.ContainerAppsRevisionReplicasClient; +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionReplicasClient. */ +public final class ContainerAppsRevisionReplicasClientImpl implements ContainerAppsRevisionReplicasClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionReplicasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsRevisionReplicasService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsRevisionReplicasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsRevisionReplicasClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create( + ContainerAppsRevisionReplicasService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisionReplicas to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsRevisionReplicasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{revisionName}/replicas/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getReplica( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("revisionName") String revisionName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{revisionName}/replicas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listReplicas( + @HostParam("$host") String endpoint, + @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); + } + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 replica for a Container App Revision along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getReplicaWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName, 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 (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 (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 + .getReplica( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getReplicaWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getReplica( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 replica for a Container App Revision on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getReplicaAsync( + String resourceGroupName, String containerAppName, String revisionName, String name) { + return getReplicaWithResponseAsync(resourceGroupName, containerAppName, revisionName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 replica for a Container App Revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicaInner getReplica( + String resourceGroupName, String containerAppName, String revisionName, String name) { + return getReplicaAsync(resourceGroupName, containerAppName, revisionName, name).block(); + } + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context) { + return getReplicaWithResponseAsync(resourceGroupName, containerAppName, revisionName, name, context).block(); + } + + /** + * List replicas for 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Revision Replicas collection ARM resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List replicas for 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 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 Revision Replicas collection ARM resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listReplicasWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listReplicas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List replicas for 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Revision Replicas collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listReplicasAsync( + String resourceGroupName, String containerAppName, String revisionName) { + return listReplicasWithResponseAsync(resourceGroupName, containerAppName, revisionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List replicas for 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Revision Replicas collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicaCollectionInner listReplicas(String resourceGroupName, String containerAppName, String revisionName) { + return listReplicasAsync(resourceGroupName, containerAppName, revisionName).block(); + } + + /** + * List replicas for 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 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 Revision Replicas collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context) { + return listReplicasWithResponseAsync(resourceGroupName, containerAppName, revisionName, context).block(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java new file mode 100644 index 0000000000000..3eab61d4de265 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionReplicasClient; +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.ContainerAppsRevisionReplicas; +import com.azure.resourcemanager.app.models.Replica; +import com.azure.resourcemanager.app.models.ReplicaCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsRevisionReplicasImpl implements ContainerAppsRevisionReplicas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionReplicasImpl.class); + + private final ContainerAppsRevisionReplicasClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsRevisionReplicasImpl( + ContainerAppsRevisionReplicasClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Replica getReplica(String resourceGroupName, String containerAppName, String revisionName, String name) { + ReplicaInner inner = this.serviceClient().getReplica(resourceGroupName, containerAppName, revisionName, name); + if (inner != null) { + return new ReplicaImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context) { + Response inner = + this + .serviceClient() + .getReplicaWithResponse(resourceGroupName, containerAppName, revisionName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicaImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicaCollection listReplicas(String resourceGroupName, String containerAppName, String revisionName) { + ReplicaCollectionInner inner = + this.serviceClient().listReplicas(resourceGroupName, containerAppName, revisionName); + if (inner != null) { + return new ReplicaCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, 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; + } + } + + private ContainerAppsRevisionReplicasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java new file mode 100644 index 0000000000000..12894a4948f3c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java @@ -0,0 +1,1042 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.app.models.RevisionCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionsClient. */ +public final class ContainerAppsRevisionsClientImpl implements ContainerAppsRevisionsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsRevisionsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsRevisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsRevisionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create(ContainerAppsRevisionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsRevisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listRevisions( + @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}/revisions/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}/activate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> activateRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}/deactivate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> deactivateRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}/restart") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> restartRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listRevisionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync( + 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 + .listRevisions( + 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 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 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} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync( + String resourceGroupName, String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRevisions( + 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)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listRevisionsNextSinglePageAsync(nextLink)); + } + + /** + * 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 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync( + String resourceGroupName, String containerAppName, Context context) { + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listRevisionsNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listRevisionsAsync(resourceGroupName, containerAppName)); + } + + /** + * 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 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions( + String resourceGroupName, String containerAppName, Context context) { + return new PagedIterable<>(listRevisionsAsync(resourceGroupName, containerAppName, 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 name 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 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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 + .getRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + 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 name 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + 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 name 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 name) { + return getRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 name 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 name) { + return getRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * 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 name 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 name, Context context) { + return getRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Activates a revision 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> activateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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 + .activateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Activates a revision 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> activateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .activateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Activates a revision 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 name 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono activateRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return activateRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Activates a revision 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 name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void activateRevision(String resourceGroupName, String containerAppName, String name) { + activateRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Activates a revision 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 name 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 the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return activateRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Deactivates a revision 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deactivateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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 + .deactivateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates a revision 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deactivateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deactivateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deactivates a revision 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 name 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deactivateRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return deactivateRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deactivates a revision 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 name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deactivateRevision(String resourceGroupName, String containerAppName, String name) { + deactivateRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Deactivates a revision 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 name 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 the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return deactivateRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Restarts a revision 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restartRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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 + .restartRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts a revision 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> restartRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restartRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Restarts a revision 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 name 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return restartRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Restarts a revision 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 name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restartRevision(String resourceGroupName, String containerAppName, String name) { + restartRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Restarts a revision 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 name 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 the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return restartRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Revisions collection ARM resource 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.")); + } + 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(), + 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 nextLink parameter. + * @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 Revisions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRevisionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java new file mode 100644 index 0000000000000..db80debf0f393 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.azure.resourcemanager.app.models.ContainerAppsRevisions; +import com.azure.resourcemanager.app.models.Revision; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsRevisionsImpl implements ContainerAppsRevisions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionsImpl.class); + + private final ContainerAppsRevisionsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsRevisionsImpl( + ContainerAppsRevisionsClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { + PagedIterable inner = this.serviceClient().listRevisions(resourceGroupName, containerAppName); + return Utils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); + } + + public PagedIterable listRevisions(String resourceGroupName, String containerAppName, Context context) { + PagedIterable inner = + this.serviceClient().listRevisions(resourceGroupName, containerAppName, context); + return Utils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); + } + + public Revision getRevision(String resourceGroupName, String containerAppName, String name) { + RevisionInner inner = this.serviceClient().getRevision(resourceGroupName, containerAppName, name); + if (inner != null) { + return new RevisionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + Response inner = + this.serviceClient().getRevisionWithResponse(resourceGroupName, containerAppName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RevisionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void activateRevision(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().activateRevision(resourceGroupName, containerAppName, name); + } + + public Response activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().activateRevisionWithResponse(resourceGroupName, containerAppName, name, context); + } + + public void deactivateRevision(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().deactivateRevision(resourceGroupName, containerAppName, name); + } + + public Response deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().deactivateRevisionWithResponse(resourceGroupName, containerAppName, name, context); + } + + public void restartRevision(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().restartRevision(resourceGroupName, containerAppName, name); + } + + public Response restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().restartRevisionWithResponse(resourceGroupName, containerAppName, name, context); + } + + private ContainerAppsRevisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java new file mode 100644 index 0000000000000..0523b8b1a0aeb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java @@ -0,0 +1,1135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.polling.PollResult; +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.app.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.app.models.SourceControlCollection; +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 ContainerAppsSourceControlsClient. */ +public final class ContainerAppsSourceControlsClientImpl implements ContainerAppsSourceControlsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsSourceControlsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsSourceControlsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsSourceControlsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsSourceControlsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create( + ContainerAppsSourceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsSourceControls to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private 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/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/sourcecontrols/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SourceControlInner sourceControlEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/sourcecontrols/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByContainerAppNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") 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. + * @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} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync( + String resourceGroupName, String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .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)); + } + + /** + * 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. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync( + String resourceGroupName, String containerAppName, Context context) { + return new PagedFlux<>( + () -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink, 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 as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, 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 DefaultErrorResponseErrorException 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<>(listByContainerAppAsync(resourceGroupName, containerAppName, context)); + } + + /** + * 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SourceControl of 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 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SourceControl of a Container App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, String name) { + return getWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SourceControl of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner get(String resourceGroupName, String containerAppName, String name) { + return getAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerAppName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + sourceControlEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + sourceControlEnvelope, + accept, + context); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SourceControlInner.class, + SourceControlInner.class, + this.client.getContext()); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SourceControlInner.class, SourceControlInner.class, context); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope) + .getSyncPoller(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context) + .getSyncPoller(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner createOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + return createOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope).block(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner createOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + return createOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context).block(); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String containerAppName, 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 (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName 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, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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 name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String containerAppName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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 name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, containerAppName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String containerAppName, String name) { + return beginDeleteAsync(resourceGroupName, containerAppName, name).getSyncPoller(); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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 name, Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, name, context).getSyncPoller(); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String containerAppName, String name) { + return beginDeleteAsync(resourceGroupName, containerAppName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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 name, Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String containerAppName, String name) { + deleteAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Description for 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 name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @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 name, Context context) { + deleteAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sourceControl collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 sourceControl collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java new file mode 100644 index 0000000000000..07084c41d1c8c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.azure.resourcemanager.app.models.ContainerAppsSourceControls; +import com.azure.resourcemanager.app.models.SourceControl; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsSourceControlsImpl implements ContainerAppsSourceControls { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsSourceControlsImpl.class); + + private final ContainerAppsSourceControlsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsSourceControlsImpl( + ContainerAppsSourceControlsClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + PagedIterable inner = + this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return Utils.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 Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public SourceControl get(String resourceGroupName, String containerAppName, String name) { + SourceControlInner inner = this.serviceClient().get(resourceGroupName, containerAppName, name); + if (inner != null) { + return new SourceControlImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, containerAppName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SourceControlImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().delete(resourceGroupName, containerAppName, name); + } + + public void delete(String resourceGroupName, String containerAppName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, name, context); + } + + public SourceControl getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + this.delete(resourceGroupName, containerAppName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + this.delete(resourceGroupName, containerAppName, name, context); + } + + private ContainerAppsSourceControlsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public SourceControlImpl define(String name) { + return new SourceControlImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CustomHostnameAnalysisResultImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CustomHostnameAnalysisResultImpl.java new file mode 100644 index 0000000000000..d4bd8469238c6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CustomHostnameAnalysisResultImpl.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.CustomHostnameAnalysisResultInner; +import com.azure.resourcemanager.app.models.CustomHostnameAnalysisResult; +import com.azure.resourcemanager.app.models.DefaultErrorResponseError; +import com.azure.resourcemanager.app.models.DnsVerificationTestResult; +import java.util.Collections; +import java.util.List; + +public final class CustomHostnameAnalysisResultImpl implements CustomHostnameAnalysisResult { + private CustomHostnameAnalysisResultInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + CustomHostnameAnalysisResultImpl( + CustomHostnameAnalysisResultInner innerObject, + com.azure.resourcemanager.app.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 hostname() { + return this.innerModel().hostname(); + } + + public Boolean isHostnameAlreadyVerified() { + return this.innerModel().isHostnameAlreadyVerified(); + } + + public DnsVerificationTestResult customDomainVerificationTest() { + return this.innerModel().customDomainVerificationTest(); + } + + public DefaultErrorResponseError customDomainVerificationFailureInfo() { + return this.innerModel().customDomainVerificationFailureInfo(); + } + + public Boolean hasConflictOnManagedEnvironment() { + return this.innerModel().hasConflictOnManagedEnvironment(); + } + + public String conflictingContainerAppResourceId() { + return this.innerModel().conflictingContainerAppResourceId(); + } + + public List cNameRecords() { + List inner = this.innerModel().cNameRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List txtRecords() { + List inner = this.innerModel().txtRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List aRecords() { + List inner = this.innerModel().aRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List alternateCNameRecords() { + List inner = this.innerModel().alternateCNameRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List alternateTxtRecords() { + List inner = this.innerModel().alternateTxtRecords(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CustomHostnameAnalysisResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentImpl.java new file mode 100644 index 0000000000000..e3a423f67dbfc --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import com.azure.resourcemanager.app.models.DaprComponent; +import com.azure.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import java.util.Collections; +import java.util.List; + +public final class DaprComponentImpl implements DaprComponent, DaprComponent.Definition, DaprComponent.Update { + private DaprComponentInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String componentType() { + return this.innerModel().componentType(); + } + + public String version() { + return this.innerModel().version(); + } + + public Boolean ignoreErrors() { + return this.innerModel().ignoreErrors(); + } + + public String initTimeout() { + return this.innerModel().initTimeout(); + } + + public List secrets() { + List inner = this.innerModel().secrets(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List metadata() { + List inner = this.innerModel().metadata(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List scopes() { + List inner = this.innerModel().scopes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DaprComponentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String name; + + public DaprComponentImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public DaprComponent create() { + this.innerObject = + serviceManager + .serviceClient() + .getDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DaprComponent create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), context) + .getValue(); + return this; + } + + DaprComponentImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new DaprComponentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public DaprComponentImpl update() { + return this; + } + + public DaprComponent apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DaprComponent apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDaprComponents() + .createOrUpdateWithResponse(resourceGroupName, environmentName, name, this.innerModel(), context) + .getValue(); + return this; + } + + DaprComponentImpl( + DaprComponentInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "daprComponents"); + } + + public DaprComponent refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDaprComponents() + .getWithResponse(resourceGroupName, environmentName, name, Context.NONE) + .getValue(); + return this; + } + + public DaprComponent refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDaprComponents() + .getWithResponse(resourceGroupName, environmentName, name, context) + .getValue(); + return this; + } + + public DaprComponentImpl withComponentType(String componentType) { + this.innerModel().withComponentType(componentType); + return this; + } + + public DaprComponentImpl withVersion(String version) { + this.innerModel().withVersion(version); + return this; + } + + public DaprComponentImpl withIgnoreErrors(Boolean ignoreErrors) { + this.innerModel().withIgnoreErrors(ignoreErrors); + return this; + } + + public DaprComponentImpl withInitTimeout(String initTimeout) { + this.innerModel().withInitTimeout(initTimeout); + return this; + } + + public DaprComponentImpl withSecrets(List secrets) { + this.innerModel().withSecrets(secrets); + return this; + } + + public DaprComponentImpl withMetadata(List metadata) { + this.innerModel().withMetadata(metadata); + return this; + } + + public DaprComponentImpl withScopes(List scopes) { + this.innerModel().withScopes(scopes); + return this; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsClientImpl.java new file mode 100644 index 0000000000000..13b409f8590bf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsClientImpl.java @@ -0,0 +1,906 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.DaprComponentsClient; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import com.azure.resourcemanager.app.models.DaprComponentsCollection; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DaprComponentsClient. */ +public final class DaprComponentsClientImpl implements DaprComponentsClient { + private final ClientLogger logger = new ClientLogger(DaprComponentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DaprComponentsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of DaprComponentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DaprComponentsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(DaprComponentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientDaprComponents to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private 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/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{environmentName}/daprComponents/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DaprComponentInner daprComponentEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{environmentName}/daprComponents/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Dapr 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. + * @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} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Dapr 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. + * @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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Dapr 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<>(listAsync(resourceGroupName, 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 DefaultErrorResponseErrorException 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<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the 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 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 name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the 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 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 name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the 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 a dapr component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String environmentName, String name) { + return getWithResponseAsync(resourceGroupName, environmentName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the 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 a dapr component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprComponentInner get(String resourceGroupName, String environmentName, String name) { + return getAsync(resourceGroupName, environmentName, name).block(); + } + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the 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 a dapr component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String environmentName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details 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 dapr Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String environmentName, String name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + daprComponentEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details 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 dapr Component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String environmentName, + String name, + DaprComponentInner daprComponentEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (daprComponentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter daprComponentEnvelope is required and cannot be null.")); + } else { + daprComponentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + daprComponentEnvelope, + accept, + context); + } + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details 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 dapr Component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String environmentName, String name, DaprComponentInner daprComponentEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, daprComponentEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details 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 dapr Component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprComponentInner createOrUpdate( + String resourceGroupName, String environmentName, String name, DaprComponentInner daprComponentEnvelope) { + return createOrUpdateAsync(resourceGroupName, environmentName, name, daprComponentEnvelope).block(); + } + + /** + * Creates or updates a Dapr 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 Dapr Component. + * @param daprComponentEnvelope Configuration details 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 dapr Component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String environmentName, + String name, + DaprComponentInner daprComponentEnvelope, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, environmentName, name, daprComponentEnvelope, context) + .block(); + } + + /** + * Delete a Dapr 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 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String environmentName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Dapr 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 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String environmentName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Dapr 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 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String environmentName, String name) { + return deleteWithResponseAsync(resourceGroupName, environmentName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete a Dapr 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 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String environmentName, String name) { + deleteAsync(resourceGroupName, environmentName, name).block(); + } + + /** + * Delete a Dapr 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 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String environmentName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, environmentName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Components ARM resource along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 Components ARM resource along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsImpl.java new file mode 100644 index 0000000000000..cd524b84ab1d4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.DaprComponentsClient; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import com.azure.resourcemanager.app.models.DaprComponent; +import com.azure.resourcemanager.app.models.DaprComponents; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DaprComponentsImpl implements DaprComponents { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DaprComponentsImpl.class); + + private final DaprComponentsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public DaprComponentsImpl( + DaprComponentsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return Utils.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 Utils.mapPage(inner, inner1 -> new DaprComponentImpl(inner1, this.manager())); + } + + public DaprComponent get(String resourceGroupName, String environmentName, String name) { + DaprComponentInner inner = this.serviceClient().get(resourceGroupName, environmentName, name); + if (inner != null) { + return new DaprComponentImpl(inner, this.manager()); + } else { + return null; + } + } + + 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 DaprComponentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String environmentName, String name) { + this.serviceClient().delete(resourceGroupName, environmentName, name); + } + + public Response deleteWithResponse( + String resourceGroupName, String environmentName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, name, context); + } + + public DaprComponent getById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "daprComponents"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "daprComponents"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "daprComponents"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + this.deleteWithResponse(resourceGroupName, environmentName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 = Utils.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 = Utils.getValueFromIdByName(id, "daprComponents"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + return this.deleteWithResponse(resourceGroupName, environmentName, name, context); + } + + private DaprComponentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public DaprComponentImpl define(String name) { + return new DaprComponentImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java new file mode 100644 index 0000000000000..fefc09a9f3255 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.ManagedEnvironment; +import com.azure.resourcemanager.app.models.ManagedEnvironmentPatch; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import java.util.Collections; +import java.util.Map; + +public final class ManagedEnvironmentImpl + implements ManagedEnvironment, ManagedEnvironment.Definition, ManagedEnvironment.Update { + private ManagedEnvironmentInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EnvironmentProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String daprAIInstrumentationKey() { + return this.innerModel().daprAIInstrumentationKey(); + } + + public VnetConfiguration vnetConfiguration() { + return this.innerModel().vnetConfiguration(); + } + + public String deploymentErrors() { + return this.innerModel().deploymentErrors(); + } + + public String defaultDomain() { + return this.innerModel().defaultDomain(); + } + + public String staticIp() { + return this.innerModel().staticIp(); + } + + public AppLogsConfiguration appLogsConfiguration() { + return this.innerModel().appLogsConfiguration(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedEnvironmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ManagedEnvironmentPatch updateEnvironmentEnvelope; + + public ManagedEnvironmentImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedEnvironment create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ManagedEnvironment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ManagedEnvironmentImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new ManagedEnvironmentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ManagedEnvironmentImpl update() { + this.updateEnvironmentEnvelope = new ManagedEnvironmentPatch(); + return this; + } + + public ManagedEnvironment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .updateWithResponse(resourceGroupName, name, updateEnvironmentEnvelope, Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .updateWithResponse(resourceGroupName, name, updateEnvironmentEnvelope, context) + .getValue(); + return this; + } + + ManagedEnvironmentImpl( + ManagedEnvironmentInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + } + + public ManagedEnvironment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ManagedEnvironmentImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedEnvironmentImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedEnvironmentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateEnvironmentEnvelope.withTags(tags); + return this; + } + } + + public ManagedEnvironmentImpl withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { + this.innerModel().withDaprAIInstrumentationKey(daprAIInstrumentationKey); + return this; + } + + public ManagedEnvironmentImpl withVnetConfiguration(VnetConfiguration vnetConfiguration) { + this.innerModel().withVnetConfiguration(vnetConfiguration); + return this; + } + + public ManagedEnvironmentImpl withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration) { + this.innerModel().withAppLogsConfiguration(appLogsConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java new file mode 100644 index 0000000000000..128a3be94f1ee --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorage; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; + +public final class ManagedEnvironmentStorageImpl + implements ManagedEnvironmentStorage, ManagedEnvironmentStorage.Definition, ManagedEnvironmentStorage.Update { + private ManagedEnvironmentStorageInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedEnvironmentStorageProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ManagedEnvironmentStorageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String envName; + + private String name; + + public ManagedEnvironmentStorageImpl withExistingManagedEnvironment(String resourceGroupName, String envName) { + this.resourceGroupName = resourceGroupName; + this.envName = envName; + return this; + } + + public ManagedEnvironmentStorage create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironmentStorage create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), context) + .getValue(); + return this; + } + + ManagedEnvironmentStorageImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new ManagedEnvironmentStorageInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ManagedEnvironmentStorageImpl update() { + return this; + } + + public ManagedEnvironmentStorage apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironmentStorage apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), context) + .getValue(); + return this; + } + + ManagedEnvironmentStorageImpl( + ManagedEnvironmentStorageInner innerObject, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.envName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "storages"); + } + + public ManagedEnvironmentStorage refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .getWithResponse(resourceGroupName, envName, name, Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironmentStorage refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .getWithResponse(resourceGroupName, envName, name, context) + .getValue(); + return this; + } + + public ManagedEnvironmentStorageImpl withProperties(ManagedEnvironmentStorageProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java new file mode 100644 index 0000000000000..30334bca0f357 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorage; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStoragesCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ManagedEnvironmentStoragesCollectionImpl implements ManagedEnvironmentStoragesCollection { + private ManagedEnvironmentStoragesCollectionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + ManagedEnvironmentStoragesCollectionImpl( + ManagedEnvironmentStoragesCollectionInner innerObject, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new ManagedEnvironmentStorageImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagedEnvironmentStoragesCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java new file mode 100644 index 0000000000000..52c5d3d38709c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java @@ -0,0 +1,1456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.app.models.ManagedEnvironmentPatch; +import com.azure.resourcemanager.app.models.ManagedEnvironmentsCollection; +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 ManagedEnvironmentsClient. */ +public final class ManagedEnvironmentsClientImpl implements ManagedEnvironmentsClient { + private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedEnvironmentsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(ManagedEnvironmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private 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}/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/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedEnvironmentPatch environmentEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get 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 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 Managed Environments 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 Managed Environments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get 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 PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all Managed Environments 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 Managed Environments for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get 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<>(listAsync()); + } + + /** + * Get all Managed Environments 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 Managed Environments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * 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 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 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 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 along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get 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 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 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, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * 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 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 PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * 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 name 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 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> getByResourceGroupWithResponseAsync( + String resourceGroupName, 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 (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 + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name 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 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> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 name 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 the properties of a Managed Environment used to host container apps on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 name 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 the properties of a Managed Environment used to host container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupAsync(resourceGroupName, name).block(); + } + + /** + * 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 name 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 the properties of a Managed Environment used to host container apps along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * 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 name 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 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 name, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context); + } + + /** + * 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 name 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 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( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, environmentEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedEnvironmentInner.class, + ManagedEnvironmentInner.class, + this.client.getContext()); + } + + /** + * 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 name 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 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( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, environmentEnvelope, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedEnvironmentInner.class, + ManagedEnvironmentInner.class, + context); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope).getSyncPoller(); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope, context).getSyncPoller(); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope) { + return createOrUpdateAsync(resourceGroupName, name, environmentEnvelope).block(); + } + + /** + * 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 name 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 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 name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, name, environmentEnvelope, context).block(); + } + + /** + * 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, 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 (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, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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 name 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * 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 name 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 name 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * 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 name 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * 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 name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 name 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * 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 name 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * 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 name 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 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> updateWithResponseAsync( + String resourceGroupName, String name, ManagedEnvironmentPatch 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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 name 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 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> updateWithResponseAsync( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context); + } + + /** + * 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 name 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 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 updateAsync( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope) { + return updateWithResponseAsync(resourceGroupName, name, environmentEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 name 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 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 update( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope) { + return updateAsync(resourceGroupName, name, environmentEnvelope).block(); + } + + /** + * 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 name 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 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) + public Response updateWithResponse( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope, Context context) { + return updateWithResponseAsync(resourceGroupName, name, environmentEnvelope, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Environments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 Environments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Environments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 Environments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java new file mode 100644 index 0000000000000..b3ce9dd0914af --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.ManagedEnvironment; +import com.azure.resourcemanager.app.models.ManagedEnvironments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedEnvironmentsImpl implements ManagedEnvironments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsImpl.class); + + private final ManagedEnvironmentsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentsImpl( + ManagedEnvironmentsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public ManagedEnvironment getByResourceGroup(String resourceGroupName, String name) { + ManagedEnvironmentInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ManagedEnvironmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedEnvironmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ManagedEnvironment getById(String id) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + this.delete(resourceGroupName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ManagedEnvironmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ManagedEnvironmentImpl define(String name) { + return new ManagedEnvironmentImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java new file mode 100644 index 0000000000000..7b5b714773164 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedEnvironmentsStoragesClient. */ +public final class ManagedEnvironmentsStoragesClientImpl implements ManagedEnvironmentsStoragesClient { + private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsStoragesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedEnvironmentsStoragesService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentsStoragesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentsStoragesClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create( + ManagedEnvironmentsStoragesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentsStorages to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ManagedEnvironmentsStoragesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{envName}/storages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @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/{envName}/storages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{envName}/storages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedEnvironmentStorageInner storageEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{envName}/storages/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @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 envName 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 envName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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 (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + 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 envName 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} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String envName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName 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 envName) { + return listWithResponseAsync(resourceGroupName, envName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName 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 envName) { + return listAsync(resourceGroupName, envName).block(); + } + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName 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 envName, Context context) { + return listWithResponseAsync(resourceGroupName, envName, context).block(); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String envName, 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 (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName 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, + envName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String envName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String envName, String name) { + return getWithResponseAsync(resourceGroupName, envName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentStorageInner get(String resourceGroupName, String envName, String name) { + return getAsync(resourceGroupName, envName, name).block(); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String envName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, envName, name, context).block(); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource for managedEnvironment along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String envName, String name, 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 (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + storageEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String envName, + String name, + ManagedEnvironmentStorageInner storageEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + storageEnvelope, + accept, + context); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource for managedEnvironment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, envName, name, storageEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource for managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentStorageInner createOrUpdate( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope) { + return createOrUpdateAsync(resourceGroupName, envName, name, storageEnvelope).block(); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String envName, + String name, + ManagedEnvironmentStorageInner storageEnvelope, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, envName, name, storageEnvelope, context).block(); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown 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 envName, 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 (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName 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, + envName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String envName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 envName, String name) { + return deleteWithResponseAsync(resourceGroupName, envName, name).flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 envName, String name) { + deleteAsync(resourceGroupName, envName, name).block(); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 envName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, envName, name, context).block(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java new file mode 100644 index 0000000000000..1d69637367247 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorage; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStoragesCollection; +import com.azure.resourcemanager.app.models.ManagedEnvironmentsStorages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedEnvironmentsStoragesImpl implements ManagedEnvironmentsStorages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsStoragesImpl.class); + + private final ManagedEnvironmentsStoragesClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentsStoragesImpl( + ManagedEnvironmentsStoragesClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagedEnvironmentStoragesCollection list(String resourceGroupName, String envName) { + ManagedEnvironmentStoragesCollectionInner inner = this.serviceClient().list(resourceGroupName, envName); + if (inner != null) { + return new ManagedEnvironmentStoragesCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String envName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, envName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedEnvironmentStoragesCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedEnvironmentStorage get(String resourceGroupName, String envName, String name) { + ManagedEnvironmentStorageInner inner = this.serviceClient().get(resourceGroupName, envName, name); + if (inner != null) { + return new ManagedEnvironmentStorageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String envName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, envName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedEnvironmentStorageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String envName, String name) { + this.serviceClient().delete(resourceGroupName, envName, name); + } + + public Response deleteWithResponse(String resourceGroupName, String envName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, envName, name, context); + } + + public ManagedEnvironmentStorage getById(String id) { + String resourceGroupName = Utils.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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.getWithResponse(resourceGroupName, envName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.getWithResponse(resourceGroupName, envName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + this.deleteWithResponse(resourceGroupName, envName, name, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.deleteWithResponse(resourceGroupName, envName, name, context); + } + + private ManagedEnvironmentsStoragesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ManagedEnvironmentStorageImpl define(String name) { + return new ManagedEnvironmentStorageImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java new file mode 100644 index 0000000000000..9be7dbe741683 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.app.models.OperationDetail; +import com.azure.resourcemanager.app.models.OperationDisplay; + +public final class OperationDetailImpl implements OperationDetail { + private OperationDetailInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + OperationDetailImpl( + OperationDetailInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..718cb83c7edcb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.OperationsClient; +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.app.models.AvailableOperations; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.App/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available RP operations. + * + * @throws 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 operations of the service 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), 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())); + } + + /** + * Lists all of the available RP operations. + * + * @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 operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available RP operations. + * + * @throws 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 operations of the service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available RP operations. + * + * @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 operations of the service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available RP operations. + * + * @throws 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 operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available RP operations. + * + * @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 operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f55cc5e8ee4bb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.OperationsClient; +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.app.models.OperationDetail; +import com.azure.resourcemanager.app.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.java new file mode 100644 index 0000000000000..9da02e26176d0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.Replica; +import com.azure.resourcemanager.app.models.ReplicaCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ReplicaCollectionImpl implements ReplicaCollection { + private ReplicaCollectionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + ReplicaCollectionImpl( + ReplicaCollectionInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner.stream().map(inner1 -> new ReplicaImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ReplicaCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java new file mode 100644 index 0000000000000..c3f368337a79f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.Replica; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ReplicaImpl implements Replica { + private ReplicaInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + ReplicaImpl(ReplicaInner innerObject, com.azure.resourcemanager.app.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 OffsetDateTime createdTime() { + return this.innerModel().createdTime(); + } + + public List containers() { + List inner = this.innerModel().containers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ReplicaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java new file mode 100644 index 0000000000000..3dd273a9371d6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.azure.resourcemanager.app.models.Revision; +import com.azure.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import java.time.OffsetDateTime; + +public final class RevisionImpl implements Revision { + private RevisionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + RevisionImpl(RevisionInner innerObject, com.azure.resourcemanager.app.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 OffsetDateTime createdTime() { + return this.innerModel().createdTime(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public Template template() { + return this.innerModel().template(); + } + + public Boolean active() { + return this.innerModel().active(); + } + + public Integer replicas() { + return this.innerModel().replicas(); + } + + public Integer trafficWeight() { + return this.innerModel().trafficWeight(); + } + + public String provisioningError() { + return this.innerModel().provisioningError(); + } + + public RevisionHealthState healthState() { + return this.innerModel().healthState(); + } + + public RevisionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RevisionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SecretsCollectionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SecretsCollectionImpl.java new file mode 100644 index 0000000000000..bf9cd722d46fe --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SecretsCollectionImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.SecretsCollectionInner; +import com.azure.resourcemanager.app.models.ContainerAppSecret; +import com.azure.resourcemanager.app.models.SecretsCollection; +import java.util.Collections; +import java.util.List; + +public final class SecretsCollectionImpl implements SecretsCollection { + private SecretsCollectionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + SecretsCollectionImpl( + SecretsCollectionInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SecretsCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java new file mode 100644 index 0000000000000..cb1b7870f8c04 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControl; +import com.azure.resourcemanager.app.models.SourceControlOperationState; + +public final class SourceControlImpl implements SourceControl, SourceControl.Definition, SourceControl.Update { + private SourceControlInner innerObject; + + private final com.azure.resourcemanager.app.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 SourceControlOperationState operationState() { + return this.innerModel().operationState(); + } + + public String repoUrl() { + return this.innerModel().repoUrl(); + } + + public String branch() { + return this.innerModel().branch(); + } + + public GithubActionConfiguration githubActionConfiguration() { + return this.innerModel().githubActionConfiguration(); + } + + public SourceControlInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerAppName; + + private String name; + + public SourceControlImpl withExistingContainerApp(String resourceGroupName, String containerAppName) { + this.resourceGroupName = resourceGroupName; + this.containerAppName = containerAppName; + return this; + } + + public SourceControl create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), Context.NONE); + return this; + } + + public SourceControl create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), context); + return this; + } + + SourceControlImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new SourceControlInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SourceControlImpl update() { + return this; + } + + public SourceControl apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), Context.NONE); + return this; + } + + public SourceControl apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), context); + return this; + } + + SourceControlImpl( + SourceControlInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerAppName = Utils.getValueFromIdByName(innerObject.id(), "containerApps"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "sourcecontrols"); + } + + public SourceControl refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .getWithResponse(resourceGroupName, containerAppName, name, Context.NONE) + .getValue(); + return this; + } + + public SourceControl refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .getWithResponse(resourceGroupName, containerAppName, name, context) + .getValue(); + return this; + } + + public SourceControlImpl withRepoUrl(String repoUrl) { + this.innerModel().withRepoUrl(repoUrl); + return this; + } + + public SourceControlImpl withBranch(String branch) { + this.innerModel().withBranch(branch); + return this; + } + + public SourceControlImpl withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration) { + this.innerModel().withGithubActionConfiguration(githubActionConfiguration); + return this; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java new file mode 100644 index 0000000000000..ee81669841723 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +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.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java new file mode 100644 index 0000000000000..9297b4ac4d699 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.implementation; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java new file mode 100644 index 0000000000000..7bf41a5906b9c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessMode. */ +public final class AccessMode extends ExpandableStringEnum { + /** Static value ReadOnly for AccessMode. */ + public static final AccessMode READ_ONLY = fromString("ReadOnly"); + + /** Static value ReadWrite for AccessMode. */ + public static final AccessMode READ_WRITE = fromString("ReadWrite"); + + /** + * Creates or finds a AccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessMode. + */ + @JsonCreator + public static AccessMode fromString(String name) { + return fromString(name, AccessMode.class); + } + + /** @return known AccessMode values. */ + public static Collection values() { + return values(AccessMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java new file mode 100644 index 0000000000000..1d7853fd98a44 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActiveRevisionsMode. */ +public final class ActiveRevisionsMode extends ExpandableStringEnum { + /** Static value multiple for ActiveRevisionsMode. */ + public static final ActiveRevisionsMode MULTIPLE = fromString("multiple"); + + /** Static value single for ActiveRevisionsMode. */ + public static final ActiveRevisionsMode SINGLE = fromString("single"); + + /** + * Creates or finds a ActiveRevisionsMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActiveRevisionsMode. + */ + @JsonCreator + public static ActiveRevisionsMode fromString(String name) { + return fromString(name, ActiveRevisionsMode.class); + } + + /** @return known ActiveRevisionsMode values. */ + public static Collection values() { + return values(ActiveRevisionsMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedAudiencesValidation.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedAudiencesValidation.java new file mode 100644 index 0000000000000..43e0d2c431052 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedAudiencesValidation.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Allowed Audiences validation flow. */ +@Fluent +public final class AllowedAudiencesValidation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AllowedAudiencesValidation.class); + + /* + * The configuration settings of the allowed list of audiences from which + * to validate the JWT token. + */ + @JsonProperty(value = "allowedAudiences") + private List allowedAudiences; + + /** + * Get the allowedAudiences property: The configuration settings of the allowed list of audiences from which to + * validate the JWT token. + * + * @return the allowedAudiences value. + */ + public List allowedAudiences() { + return this.allowedAudiences; + } + + /** + * Set the allowedAudiences property: The configuration settings of the allowed list of audiences from which to + * validate the JWT token. + * + * @param allowedAudiences the allowedAudiences value to set. + * @return the AllowedAudiencesValidation object itself. + */ + public AllowedAudiencesValidation withAllowedAudiences(List allowedAudiences) { + this.allowedAudiences = allowedAudiences; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java new file mode 100644 index 0000000000000..cfac0f5e3e785 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration of application logs. */ +@Fluent +public final class AppLogsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppLogsConfiguration.class); + + /* + * Logs destination + */ + @JsonProperty(value = "destination") + private String destination; + + /* + * Log Analytics configuration + */ + @JsonProperty(value = "logAnalyticsConfiguration") + private LogAnalyticsConfiguration logAnalyticsConfiguration; + + /** + * Get the destination property: Logs destination. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Logs destination. + * + * @param destination the destination value to set. + * @return the AppLogsConfiguration object itself. + */ + public AppLogsConfiguration withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the logAnalyticsConfiguration property: Log Analytics configuration. + * + * @return the logAnalyticsConfiguration value. + */ + public LogAnalyticsConfiguration logAnalyticsConfiguration() { + return this.logAnalyticsConfiguration; + } + + /** + * Set the logAnalyticsConfiguration property: Log Analytics configuration. + * + * @param logAnalyticsConfiguration the logAnalyticsConfiguration value to set. + * @return the AppLogsConfiguration object itself. + */ + public AppLogsConfiguration withLogAnalyticsConfiguration(LogAnalyticsConfiguration logAnalyticsConfiguration) { + this.logAnalyticsConfiguration = logAnalyticsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalyticsConfiguration() != null) { + logAnalyticsConfiguration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java new file mode 100644 index 0000000000000..41806e7b5dfaf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AppProtocol. */ +public final class AppProtocol extends ExpandableStringEnum { + /** Static value http for AppProtocol. */ + public static final AppProtocol HTTP = fromString("http"); + + /** Static value grpc for AppProtocol. */ + public static final AppProtocol GRPC = fromString("grpc"); + + /** + * Creates or finds a AppProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppProtocol. + */ + @JsonCreator + public static AppProtocol fromString(String name) { + return fromString(name, AppProtocol.class); + } + + /** @return known AppProtocol values. */ + public static Collection values() { + return values(AppProtocol.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppRegistration.java new file mode 100644 index 0000000000000..f96aaf3675ab8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppRegistration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the app registration for providers that have app ids and app secrets. */ +@Fluent +public final class AppRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppRegistration.class); + + /* + * The App ID of the app used for login. + */ + @JsonProperty(value = "appId") + private String appId; + + /* + * The app secret ref name that contains the app secret. + */ + @JsonProperty(value = "appSecretRefName") + private String appSecretRefName; + + /** + * Get the appId property: The App ID of the app used for login. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId property: The App ID of the app used for login. + * + * @param appId the appId value to set. + * @return the AppRegistration object itself. + */ + public AppRegistration withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the appSecretRefName property: The app secret ref name that contains the app secret. + * + * @return the appSecretRefName value. + */ + public String appSecretRefName() { + return this.appSecretRefName; + } + + /** + * Set the appSecretRefName property: The app secret ref name that contains the app secret. + * + * @param appSecretRefName the appSecretRefName value to set. + * @return the AppRegistration object itself. + */ + public AppRegistration withAppSecretRefName(String appSecretRefName) { + this.appSecretRefName = appSecretRefName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Apple.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Apple.java new file mode 100644 index 0000000000000..8541affd02bf2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Apple.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Apple provider. */ +@Fluent +public final class Apple { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Apple.class); + + /* + * Disabled if the Apple provider should not be enabled + * despite the set registration; otherwise, Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the Apple registration. + */ + @JsonProperty(value = "registration") + private AppleRegistration registration; + + /* + * The configuration settings of the login flow. + */ + @JsonProperty(value = "login") + private LoginScopes login; + + /** + * Get the state property: <code>Disabled</code> if the Apple provider should not be enabled despite the + * set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the Apple provider should not be enabled despite the + * set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the Apple object itself. + */ + public Apple withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the Apple registration. + * + * @return the registration value. + */ + public AppleRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the Apple registration. + * + * @param registration the registration value to set. + * @return the Apple object itself. + */ + public Apple withRegistration(AppleRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow. + * + * @return the login value. + */ + public LoginScopes login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow. + * + * @param login the login value to set. + * @return the Apple object itself. + */ + public Apple withLogin(LoginScopes login) { + this.login = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppleRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppleRegistration.java new file mode 100644 index 0000000000000..35c00d94b8c8b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppleRegistration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the registration for the Apple provider. */ +@Fluent +public final class AppleRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppleRegistration.class); + + /* + * The Client ID of the app used for login. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The app secret ref name that contains the client secret. + */ + @JsonProperty(value = "clientSecretRefName") + private String clientSecretRefName; + + /** + * Get the clientId property: The Client ID of the app used for login. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The Client ID of the app used for login. + * + * @param clientId the clientId value to set. + * @return the AppleRegistration object itself. + */ + public AppleRegistration withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecretRefName property: The app secret ref name that contains the client secret. + * + * @return the clientSecretRefName value. + */ + public String clientSecretRefName() { + return this.clientSecretRefName; + } + + /** + * Set the clientSecretRefName property: The app secret ref name that contains the client secret. + * + * @param clientSecretRefName the clientSecretRefName value to set. + * @return the AppleRegistration object itself. + */ + public AppleRegistration withClientSecretRefName(String clientSecretRefName) { + this.clientSecretRefName = clientSecretRefName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfig.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfig.java new file mode 100644 index 0000000000000..fda94c27a67e7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfig.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.AuthConfigInner; + +/** An immutable client-side representation of AuthConfig. */ +public interface AuthConfig { + /** + * 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 state property: <code>Enabled</code> if the Authentication / Authorization feature is + * enabled for the current app; otherwise, <code>Disabled</code>. + * + * @return the state value. + */ + EasyAuthState state(); + + /** + * Gets the globalValidation property: The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * + * @return the globalValidation value. + */ + GlobalValidation globalValidation(); + + /** + * Gets the identityProviders property: The configuration settings of each of the identity providers used to + * configure ContainerApp Authentication/Authorization. + * + * @return the identityProviders value. + */ + IdentityProviders identityProviders(); + + /** + * Gets the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * + * @return the login value. + */ + Login login(); + + /** + * Gets the httpSettings property: The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp Authentication/Authorization. + * + * @return the httpSettings value. + */ + HttpSettings httpSettings(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.AuthConfigInner object. + * + * @return the inner object. + */ + AuthConfigInner innerModel(); + + /** The entirety of the AuthConfig definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The AuthConfig definition stages. */ + interface DefinitionStages { + /** The first stage of the AuthConfig definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the AuthConfig definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, containerAppName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @return the next definition stage. + */ + WithCreate withExistingContainerApp(String resourceGroupName, String containerAppName); + } + /** + * The stage of the AuthConfig 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.WithState, + DefinitionStages.WithGlobalValidation, + DefinitionStages.WithIdentityProviders, + DefinitionStages.WithLogin, + DefinitionStages.WithHttpSettings { + /** + * Executes the create request. + * + * @return the created resource. + */ + AuthConfig create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AuthConfig create(Context context); + } + /** The stage of the AuthConfig definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: <code>Enabled</code> if the Authentication / Authorization + * feature is enabled for the current app; otherwise, <code>Disabled</code>.. + * + * @param state <code>Enabled</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>Disabled</code>. + * @return the next definition stage. + */ + WithCreate withState(EasyAuthState state); + } + /** The stage of the AuthConfig definition allowing to specify globalValidation. */ + interface WithGlobalValidation { + /** + * Specifies the globalValidation property: The configuration settings that determines the validation flow + * of users using ContainerApp Authentication/Authorization.. + * + * @param globalValidation The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * @return the next definition stage. + */ + WithCreate withGlobalValidation(GlobalValidation globalValidation); + } + /** The stage of the AuthConfig definition allowing to specify identityProviders. */ + interface WithIdentityProviders { + /** + * Specifies the identityProviders property: The configuration settings of each of the identity providers + * used to configure ContainerApp Authentication/Authorization.. + * + * @param identityProviders The configuration settings of each of the identity providers used to configure + * ContainerApp Authentication/Authorization. + * @return the next definition stage. + */ + WithCreate withIdentityProviders(IdentityProviders identityProviders); + } + /** The stage of the AuthConfig definition allowing to specify login. */ + interface WithLogin { + /** + * Specifies the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization.. + * + * @param login The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * @return the next definition stage. + */ + WithCreate withLogin(Login login); + } + /** The stage of the AuthConfig definition allowing to specify httpSettings. */ + interface WithHttpSettings { + /** + * Specifies the httpSettings property: The configuration settings of the HTTP requests for authentication + * and authorization requests made against ContainerApp Authentication/Authorization.. + * + * @param httpSettings The configuration settings of the HTTP requests for authentication and authorization + * requests made against ContainerApp Authentication/Authorization. + * @return the next definition stage. + */ + WithCreate withHttpSettings(HttpSettings httpSettings); + } + } + /** + * Begins update for the AuthConfig resource. + * + * @return the stage of resource update. + */ + AuthConfig.Update update(); + + /** The template for AuthConfig update. */ + interface Update + extends UpdateStages.WithState, + UpdateStages.WithGlobalValidation, + UpdateStages.WithIdentityProviders, + UpdateStages.WithLogin, + UpdateStages.WithHttpSettings { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AuthConfig apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AuthConfig apply(Context context); + } + /** The AuthConfig update stages. */ + interface UpdateStages { + /** The stage of the AuthConfig update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: <code>Enabled</code> if the Authentication / Authorization + * feature is enabled for the current app; otherwise, <code>Disabled</code>.. + * + * @param state <code>Enabled</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>Disabled</code>. + * @return the next definition stage. + */ + Update withState(EasyAuthState state); + } + /** The stage of the AuthConfig update allowing to specify globalValidation. */ + interface WithGlobalValidation { + /** + * Specifies the globalValidation property: The configuration settings that determines the validation flow + * of users using ContainerApp Authentication/Authorization.. + * + * @param globalValidation The configuration settings that determines the validation flow of users using + * ContainerApp Authentication/Authorization. + * @return the next definition stage. + */ + Update withGlobalValidation(GlobalValidation globalValidation); + } + /** The stage of the AuthConfig update allowing to specify identityProviders. */ + interface WithIdentityProviders { + /** + * Specifies the identityProviders property: The configuration settings of each of the identity providers + * used to configure ContainerApp Authentication/Authorization.. + * + * @param identityProviders The configuration settings of each of the identity providers used to configure + * ContainerApp Authentication/Authorization. + * @return the next definition stage. + */ + Update withIdentityProviders(IdentityProviders identityProviders); + } + /** The stage of the AuthConfig update allowing to specify login. */ + interface WithLogin { + /** + * Specifies the login property: The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization.. + * + * @param login The configuration settings of the login flow of users using ContainerApp + * Authentication/Authorization. + * @return the next definition stage. + */ + Update withLogin(Login login); + } + /** The stage of the AuthConfig update allowing to specify httpSettings. */ + interface WithHttpSettings { + /** + * Specifies the httpSettings property: The configuration settings of the HTTP requests for authentication + * and authorization requests made against ContainerApp Authentication/Authorization.. + * + * @param httpSettings The configuration settings of the HTTP requests for authentication and authorization + * requests made against ContainerApp Authentication/Authorization. + * @return the next definition stage. + */ + Update withHttpSettings(HttpSettings httpSettings); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AuthConfig refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AuthConfig refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfigCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfigCollection.java new file mode 100644 index 0000000000000..abbf1e15fdaa6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfigCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.AuthConfigInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AuthConfig collection ARM resource. */ +@Fluent +public final class AuthConfigCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AuthConfigCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the AuthConfigCollection object itself. + */ + public AuthConfigCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AuthConfigCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java new file mode 100644 index 0000000000000..d5882c06006e9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Available operations of the service. */ +@Fluent +public final class AvailableOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperations.class); + + /* + * Collection of available operation details + */ + @JsonProperty(value = "value") + 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. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of available operation details. + * + * @return the value value. + */ + public List value() { + return this.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. + * + * @return the nextLink value. + */ + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectory.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectory.java new file mode 100644 index 0000000000000..c62bef75f1730 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectory.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Azure Active directory provider. */ +@Fluent +public final class AzureActiveDirectory { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectory.class); + + /* + * Disabled if the Azure Active Directory provider should not + * be enabled despite the set registration; otherwise, + * Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the Azure Active Directory app + * registration. + */ + @JsonProperty(value = "registration") + private AzureActiveDirectoryRegistration registration; + + /* + * The configuration settings of the Azure Active Directory login flow. + */ + @JsonProperty(value = "login") + private AzureActiveDirectoryLogin login; + + /* + * The configuration settings of the Azure Active Directory token + * validation flow. + */ + @JsonProperty(value = "validation") + private AzureActiveDirectoryValidation validation; + + /** + * Get the state property: <code>Disabled</code> if the Azure Active Directory provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the Azure Active Directory provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the Azure Active Directory app registration. + * + * @return the registration value. + */ + public AzureActiveDirectoryRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the Azure Active Directory app registration. + * + * @param registration the registration value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withRegistration(AzureActiveDirectoryRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the login property: The configuration settings of the Azure Active Directory login flow. + * + * @return the login value. + */ + public AzureActiveDirectoryLogin login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the Azure Active Directory login flow. + * + * @param login the login value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withLogin(AzureActiveDirectoryLogin login) { + this.login = login; + return this; + } + + /** + * Get the validation property: The configuration settings of the Azure Active Directory token validation flow. + * + * @return the validation value. + */ + public AzureActiveDirectoryValidation validation() { + return this.validation; + } + + /** + * Set the validation property: The configuration settings of the Azure Active Directory token validation flow. + * + * @param validation the validation value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withValidation(AzureActiveDirectoryValidation validation) { + this.validation = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryLogin.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryLogin.java new file mode 100644 index 0000000000000..8b8a1425a874e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryLogin.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Azure Active Directory login flow. */ +@Fluent +public final class AzureActiveDirectoryLogin { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectoryLogin.class); + + /* + * Login parameters to send to the OpenID Connect authorization endpoint + * when + * a user logs in. Each parameter must be in the form "key=value". + */ + @JsonProperty(value = "loginParameters") + private List loginParameters; + + /* + * true if the www-authenticate provider should be omitted + * from the request; otherwise, false. + */ + @JsonProperty(value = "disableWwwAuthenticate") + private DisableWwwAuthenticateMode disableWwwAuthenticate; + + /** + * Get the loginParameters property: Login parameters to send to the OpenID Connect authorization endpoint when a + * user logs in. Each parameter must be in the form "key=value". + * + * @return the loginParameters value. + */ + public List loginParameters() { + return this.loginParameters; + } + + /** + * Set the loginParameters property: Login parameters to send to the OpenID Connect authorization endpoint when a + * user logs in. Each parameter must be in the form "key=value". + * + * @param loginParameters the loginParameters value to set. + * @return the AzureActiveDirectoryLogin object itself. + */ + public AzureActiveDirectoryLogin withLoginParameters(List loginParameters) { + this.loginParameters = loginParameters; + return this; + } + + /** + * Get the disableWwwAuthenticate property: <code>true</code> if the www-authenticate provider should be + * omitted from the request; otherwise, <code>false</code>. + * + * @return the disableWwwAuthenticate value. + */ + public DisableWwwAuthenticateMode disableWwwAuthenticate() { + return this.disableWwwAuthenticate; + } + + /** + * Set the disableWwwAuthenticate property: <code>true</code> if the www-authenticate provider should be + * omitted from the request; otherwise, <code>false</code>. + * + * @param disableWwwAuthenticate the disableWwwAuthenticate value to set. + * @return the AzureActiveDirectoryLogin object itself. + */ + public AzureActiveDirectoryLogin withDisableWwwAuthenticate(DisableWwwAuthenticateMode disableWwwAuthenticate) { + this.disableWwwAuthenticate = disableWwwAuthenticate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryRegistration.java new file mode 100644 index 0000000000000..33e66af7305e9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryRegistration.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Azure Active Directory app registration. */ +@Fluent +public final class AzureActiveDirectoryRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectoryRegistration.class); + + /* + * The OpenID Connect Issuer URI that represents the entity which issues + * access tokens for this application. + * When using Azure Active Directory, this value is the URI of the + * directory tenant, e.g. + * https://login.microsoftonline.com/v2.0/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + */ + @JsonProperty(value = "openIdIssuer") + private String openIdIssuer; + + /* + * The Client ID of this relying party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication + * with Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The app secret ref name that contains the client secret of the relying + * party application. + */ + @JsonProperty(value = "clientSecretRefName") + private String clientSecretRefName; + + /* + * An alternative to the client secret, that is the thumbprint of a + * certificate used for signing purposes. This property acts as + * a replacement for the Client Secret. It is also optional. + */ + @JsonProperty(value = "clientSecretCertificateThumbprint") + private String clientSecretCertificateThumbprint; + + /* + * An alternative to the client secret thumbprint, that is the subject + * alternative name of a certificate used for signing purposes. This + * property acts as + * a replacement for the Client Secret Certificate Thumbprint. It is also + * optional. + */ + @JsonProperty(value = "clientSecretCertificateSubjectAlternativeName") + private String clientSecretCertificateSubjectAlternativeName; + + /* + * An alternative to the client secret thumbprint, that is the issuer of a + * certificate used for signing purposes. This property acts as + * a replacement for the Client Secret Certificate Thumbprint. It is also + * optional. + */ + @JsonProperty(value = "clientSecretCertificateIssuer") + private String clientSecretCertificateIssuer; + + /** + * Get the openIdIssuer property: The OpenID Connect Issuer URI that represents the entity which issues access + * tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, + * e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. This URI is a case-sensitive identifier for the token + * issuer. More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. + * + * @return the openIdIssuer value. + */ + public String openIdIssuer() { + return this.openIdIssuer; + } + + /** + * Set the openIdIssuer property: The OpenID Connect Issuer URI that represents the entity which issues access + * tokens for this application. When using Azure Active Directory, this value is the URI of the directory tenant, + * e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. This URI is a case-sensitive identifier for the token + * issuer. More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html. + * + * @param openIdIssuer the openIdIssuer value to set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withOpenIdIssuer(String openIdIssuer) { + this.openIdIssuer = openIdIssuer; + return this; + } + + /** + * Get the clientId property: The Client ID of this relying party application, known as the client_id. This setting + * is required for enabling OpenID Connection authentication with Azure Active Directory or other 3rd party OpenID + * Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The Client ID of this relying party application, known as the client_id. This setting + * is required for enabling OpenID Connection authentication with Azure Active Directory or other 3rd party OpenID + * Connect providers. More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html. + * + * @param clientId the clientId value to set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecretRefName property: The app secret ref name that contains the client secret of the relying + * party application. + * + * @return the clientSecretRefName value. + */ + public String clientSecretRefName() { + return this.clientSecretRefName; + } + + /** + * Set the clientSecretRefName property: The app secret ref name that contains the client secret of the relying + * party application. + * + * @param clientSecretRefName the clientSecretRefName value to set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withClientSecretRefName(String clientSecretRefName) { + this.clientSecretRefName = clientSecretRefName; + return this; + } + + /** + * Get the clientSecretCertificateThumbprint property: An alternative to the client secret, that is the thumbprint + * of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also + * optional. + * + * @return the clientSecretCertificateThumbprint value. + */ + public String clientSecretCertificateThumbprint() { + return this.clientSecretCertificateThumbprint; + } + + /** + * Set the clientSecretCertificateThumbprint property: An alternative to the client secret, that is the thumbprint + * of a certificate used for signing purposes. This property acts as a replacement for the Client Secret. It is also + * optional. + * + * @param clientSecretCertificateThumbprint the clientSecretCertificateThumbprint value to set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withClientSecretCertificateThumbprint( + String clientSecretCertificateThumbprint) { + this.clientSecretCertificateThumbprint = clientSecretCertificateThumbprint; + return this; + } + + /** + * Get the clientSecretCertificateSubjectAlternativeName property: An alternative to the client secret thumbprint, + * that is the subject alternative name of a certificate used for signing purposes. This property acts as a + * replacement for the Client Secret Certificate Thumbprint. It is also optional. + * + * @return the clientSecretCertificateSubjectAlternativeName value. + */ + public String clientSecretCertificateSubjectAlternativeName() { + return this.clientSecretCertificateSubjectAlternativeName; + } + + /** + * Set the clientSecretCertificateSubjectAlternativeName property: An alternative to the client secret thumbprint, + * that is the subject alternative name of a certificate used for signing purposes. This property acts as a + * replacement for the Client Secret Certificate Thumbprint. It is also optional. + * + * @param clientSecretCertificateSubjectAlternativeName the clientSecretCertificateSubjectAlternativeName value to + * set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withClientSecretCertificateSubjectAlternativeName( + String clientSecretCertificateSubjectAlternativeName) { + this.clientSecretCertificateSubjectAlternativeName = clientSecretCertificateSubjectAlternativeName; + return this; + } + + /** + * Get the clientSecretCertificateIssuer property: An alternative to the client secret thumbprint, that is the + * issuer of a certificate used for signing purposes. This property acts as a replacement for the Client Secret + * Certificate Thumbprint. It is also optional. + * + * @return the clientSecretCertificateIssuer value. + */ + public String clientSecretCertificateIssuer() { + return this.clientSecretCertificateIssuer; + } + + /** + * Set the clientSecretCertificateIssuer property: An alternative to the client secret thumbprint, that is the + * issuer of a certificate used for signing purposes. This property acts as a replacement for the Client Secret + * Certificate Thumbprint. It is also optional. + * + * @param clientSecretCertificateIssuer the clientSecretCertificateIssuer value to set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withClientSecretCertificateIssuer(String clientSecretCertificateIssuer) { + this.clientSecretCertificateIssuer = clientSecretCertificateIssuer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryValidation.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryValidation.java new file mode 100644 index 0000000000000..ea64f197e843c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryValidation.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Azure Active Directory token validation flow. */ +@Fluent +public final class AzureActiveDirectoryValidation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureActiveDirectoryValidation.class); + + /* + * The list of audiences that can make successful + * authentication/authorization requests. + */ + @JsonProperty(value = "allowedAudiences") + private List allowedAudiences; + + /** + * Get the allowedAudiences property: The list of audiences that can make successful authentication/authorization + * requests. + * + * @return the allowedAudiences value. + */ + public List allowedAudiences() { + return this.allowedAudiences; + } + + /** + * Set the allowedAudiences property: The list of audiences that can make successful authentication/authorization + * requests. + * + * @param allowedAudiences the allowedAudiences value to set. + * @return the AzureActiveDirectoryValidation object itself. + */ + public AzureActiveDirectoryValidation withAllowedAudiences(List allowedAudiences) { + this.allowedAudiences = allowedAudiences; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java new file mode 100644 index 0000000000000..c3216f82d50c7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App credentials. */ +@Fluent +public final class AzureCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureCredentials.class); + + /* + * Client Id. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Client Secret. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * Tenant Id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Subscription Id. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * Get the clientId property: Client Id. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id. + * + * @param clientId the clientId value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client Secret. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client Secret. + * + * @param clientSecret the clientSecret value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the tenantId property: Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id. + * + * @param tenantId the tenantId value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java new file mode 100644 index 0000000000000..277ac872fb889 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure File Properties. */ +@Fluent +public final class AzureFileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileProperties.class); + + /* + * Storage account name for azure file. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /* + * Storage account key for azure file. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /* + * Access mode for storage + */ + @JsonProperty(value = "accessMode") + private AccessMode accessMode; + + /* + * Azure file share name. + */ + @JsonProperty(value = "shareName") + private String shareName; + + /** + * Get the accountName property: Storage account name for azure file. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Storage account name for azure file. + * + * @param accountName the accountName value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the accountKey property: Storage account key for azure file. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Storage account key for azure file. + * + * @param accountKey the accountKey value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the accessMode property: Access mode for storage. + * + * @return the accessMode value. + */ + public AccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode for storage. + * + * @param accessMode the accessMode value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * Get the shareName property: Azure file share name. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: Azure file share name. + * + * @param shareName the shareName value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebApp.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebApp.java new file mode 100644 index 0000000000000..b7a37d3d58bb8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebApp.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Azure Static Web Apps provider. */ +@Fluent +public final class AzureStaticWebApp { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStaticWebApp.class); + + /* + * Disabled if the Azure Static Web Apps provider should not + * be enabled despite the set registration; otherwise, + * Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the Azure Static Web Apps registration. + */ + @JsonProperty(value = "registration") + private AzureStaticWebAppRegistration registration; + + /** + * Get the state property: <code>Disabled</code> if the Azure Static Web Apps provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the Azure Static Web Apps provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the AzureStaticWebApp object itself. + */ + public AzureStaticWebApp withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the Azure Static Web Apps registration. + * + * @return the registration value. + */ + public AzureStaticWebAppRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the Azure Static Web Apps registration. + * + * @param registration the registration value to set. + * @return the AzureStaticWebApp object itself. + */ + public AzureStaticWebApp withRegistration(AzureStaticWebAppRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registration() != null) { + registration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppRegistration.java new file mode 100644 index 0000000000000..0f23ca2da18d1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppRegistration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the registration for the Azure Static Web Apps provider. */ +@Fluent +public final class AzureStaticWebAppRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureStaticWebAppRegistration.class); + + /* + * The Client ID of the app used for login. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get the clientId property: The Client ID of the app used for login. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The Client ID of the app used for login. + * + * @param clientId the clientId value to set. + * @return the AzureStaticWebAppRegistration object itself. + */ + public AzureStaticWebAppRegistration withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/BindingType.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/BindingType.java new file mode 100644 index 0000000000000..8fe1588fff1ad --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/BindingType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BindingType. */ +public final class BindingType extends ExpandableStringEnum { + /** Static value Disabled for BindingType. */ + public static final BindingType DISABLED = fromString("Disabled"); + + /** Static value SniEnabled for BindingType. */ + public static final BindingType SNI_ENABLED = fromString("SniEnabled"); + + /** + * Creates or finds a BindingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BindingType. + */ + @JsonCreator + public static BindingType fromString(String name) { + return fromString(name, BindingType.class); + } + + /** @return known BindingType values. */ + public static Collection values() { + return values(BindingType.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificate.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificate.java new file mode 100644 index 0000000000000..d060d6ff7ef64 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificate.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.CertificateInner; +import java.util.Map; + +/** An immutable client-side representation of Certificate. */ +public interface Certificate { + /** + * 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: Certificate resource specific properties. + * + * @return the properties value. + */ + CertificateProperties 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 inner com.azure.resourcemanager.app.fluent.models.CertificateInner object. + * + * @return the inner object. + */ + CertificateInner innerModel(); + + /** The entirety of the Certificate definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Certificate definition stages. */ + interface DefinitionStages { + /** The first stage of the Certificate definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Certificate 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Certificate definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, managedEnvironmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String managedEnvironmentName); + } + /** + * The stage of the Certificate 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. + */ + Certificate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Certificate create(Context context); + } + /** The stage of the Certificate 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 Certificate definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Certificate resource specific properties. + * + * @param properties Certificate resource specific properties. + * @return the next definition stage. + */ + WithCreate withProperties(CertificateProperties properties); + } + } + /** + * Begins update for the Certificate resource. + * + * @return the stage of resource update. + */ + Certificate.Update update(); + + /** The template for Certificate update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Certificate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Certificate apply(Context context); + } + /** The Certificate update stages. */ + interface UpdateStages { + /** The stage of the Certificate update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. + * + * @param tags Application-specific metadata in the form of key-value pairs. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Certificate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Certificate refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateCollection.java new file mode 100644 index 0000000000000..d5a34b542a223 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.CertificateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Certificates. */ +@Fluent +public final class CertificateCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the CertificateCollection object itself. + */ + public CertificateCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model CertificateCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificatePatch.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificatePatch.java new file mode 100644 index 0000000000000..a1d317cd325aa --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificatePatch.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A certificate to update. */ +@Fluent +public final class CertificatePatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificatePatch.class); + + /* + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Application-specific metadata in the form of key-value pairs. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set. + * @return the CertificatePatch object itself. + */ + public CertificatePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProperties.java new file mode 100644 index 0000000000000..5b0b03a8098d2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProperties.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Certificate resource specific properties. */ +@Fluent +public final class CertificateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateProperties.class); + + /* + * Certificate password. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Subject name of the certificate. + */ + @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) + private String subjectName; + + /* + * PFX or PEM blob + */ + @JsonProperty(value = "value") + private byte[] value; + + /* + * Certificate issuer. + */ + @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) + private String issuer; + + /* + * Certificate issue Date. + */ + @JsonProperty(value = "issueDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime issueDate; + + /* + * Certificate expiration date. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime expirationDate; + + /* + * Certificate thumbprint. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /* + * Is the certificate valid?. + */ + @JsonProperty(value = "valid", access = JsonProperty.Access.WRITE_ONLY) + private Boolean valid; + + /* + * Public key hash. + */ + @JsonProperty(value = "publicKeyHash", access = JsonProperty.Access.WRITE_ONLY) + private String publicKeyHash; + + /** + * Get the password property: Certificate password. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Certificate password. + * + * @param password the password value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the subjectName property: Subject name of the certificate. + * + * @return the subjectName value. + */ + public String subjectName() { + return this.subjectName; + } + + /** + * Get the value property: PFX or PEM blob. + * + * @return the value value. + */ + public byte[] value() { + return CoreUtils.clone(this.value); + } + + /** + * Set the value property: PFX or PEM blob. + * + * @param value the value value to set. + * @return the CertificateProperties object itself. + */ + public CertificateProperties withValue(byte[] value) { + this.value = CoreUtils.clone(value); + return this; + } + + /** + * Get the issuer property: Certificate issuer. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Get the issueDate property: Certificate issue Date. + * + * @return the issueDate value. + */ + public OffsetDateTime issueDate() { + return this.issueDate; + } + + /** + * Get the expirationDate property: Certificate expiration date. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Get the thumbprint property: Certificate thumbprint. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get the valid property: Is the certificate valid?. + * + * @return the valid value. + */ + public Boolean valid() { + return this.valid; + } + + /** + * Get the publicKeyHash property: Public key hash. + * + * @return the publicKeyHash value. + */ + public String publicKeyHash() { + return this.publicKeyHash; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificates.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificates.java new file mode 100644 index 0000000000000..f9bde8ee2fb35 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Certificates.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 Certificates. */ +public interface Certificates { + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable list(String resourceGroupName, String managedEnvironmentName); + + /** + * Get the Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName 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.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable list(String resourceGroupName, String managedEnvironmentName, Context context); + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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 managedEnvironmentName, String name); + + /** + * Get the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException 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 managedEnvironmentName, String name, Context context); + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name Name of the Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 managedEnvironmentName, String name); + + /** + * Deletes the specified Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown 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 managedEnvironmentName, String name, Context context); + + /** + * Get the specified Certificate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + Certificate getById(String id); + + /** + * Get the specified Certificate. + * + * @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.app.models.DefaultErrorResponseErrorException 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 getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Certificate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Certificate. + * + * @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.app.models.DefaultErrorResponseErrorException thrown 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 Certificate resource. + * + * @param name resource name. + * @return the first stage of the new Certificate definition. + */ + Certificate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientRegistration.java new file mode 100644 index 0000000000000..2036c11a0f78a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientRegistration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the app registration for providers that have client ids and client secrets. */ +@Fluent +public final class ClientRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientRegistration.class); + + /* + * The Client ID of the app used for login. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The app secret ref name that contains the client secret. + */ + @JsonProperty(value = "clientSecretRefName") + private String clientSecretRefName; + + /** + * Get the clientId property: The Client ID of the app used for login. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The Client ID of the app used for login. + * + * @param clientId the clientId value to set. + * @return the ClientRegistration object itself. + */ + public ClientRegistration withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecretRefName property: The app secret ref name that contains the client secret. + * + * @return the clientSecretRefName value. + */ + public String clientSecretRefName() { + return this.clientSecretRefName; + } + + /** + * Set the clientSecretRefName property: The app secret ref name that contains the client secret. + * + * @param clientSecretRefName the clientSecretRefName value to set. + * @return the ClientRegistration object itself. + */ + public ClientRegistration withClientSecretRefName(String clientSecretRefName) { + this.clientSecretRefName = clientSecretRefName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java new file mode 100644 index 0000000000000..c872aa8808840 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Non versioned Container App configuration properties that define the mutable settings of a Container app. */ +@Fluent +public final class Configuration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Configuration.class); + + /* + * Collection of secrets used by a Container app + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * ActiveRevisionsMode controls how active revisions are handled for the + * Container app: + * Multiple: multiple revisions can be active. If no value if + * provided, this is the defaultSingle: Only one revision can + * be active at a time. Revision weights can not be used in this + * mode + */ + @JsonProperty(value = "activeRevisionsMode") + private ActiveRevisionsMode activeRevisionsMode; + + /* + * Ingress configurations. + */ + @JsonProperty(value = "ingress") + private Ingress ingress; + + /* + * Collection of private container registry credentials for containers used + * by the Container app + */ + @JsonProperty(value = "registries") + private List registries; + + /** + * Get the secrets property: Collection of secrets used by a Container app. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Collection of secrets used by a Container app. + * + * @param secrets the secrets value to set. + * @return the Configuration object itself. + */ + public Configuration withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the + * Container app: <list><item>Multiple: multiple revisions can be active. If no value if provided, this + * is the default</item><item>Single: Only one revision can be active at a time. Revision weights can + * not be used in this mode</item></list>. + * + * @return the activeRevisionsMode value. + */ + public ActiveRevisionsMode activeRevisionsMode() { + return this.activeRevisionsMode; + } + + /** + * Set the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the + * Container app: <list><item>Multiple: multiple revisions can be active. If no value if provided, this + * is the default</item><item>Single: Only one revision can be active at a time. Revision weights can + * not be used in this mode</item></list>. + * + * @param activeRevisionsMode the activeRevisionsMode value to set. + * @return the Configuration object itself. + */ + public Configuration withActiveRevisionsMode(ActiveRevisionsMode activeRevisionsMode) { + this.activeRevisionsMode = activeRevisionsMode; + return this; + } + + /** + * Get the ingress property: Ingress configurations. + * + * @return the ingress value. + */ + public Ingress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the Configuration object itself. + */ + public Configuration withIngress(Ingress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the registries property: Collection of private container registry credentials for containers used by the + * Container app. + * + * @return the registries value. + */ + public List registries() { + return this.registries; + } + + /** + * Set the registries property: Collection of private container registry credentials for containers used by the + * Container app. + * + * @param registries the registries value to set. + * @return the Configuration object itself. + */ + public Configuration withRegistries(List registries) { + this.registries = registries; + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java new file mode 100644 index 0000000000000..140db4b5dedb8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App container definition. */ +@Fluent +public final class Container { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Container.class); + + /* + * Container image tag. + */ + @JsonProperty(value = "image") + private String image; + + /* + * Custom container name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Container start command. + */ + @JsonProperty(value = "command") + private List command; + + /* + * Container start command arguments. + */ + @JsonProperty(value = "args") + private List args; + + /* + * Container environment variables. + */ + @JsonProperty(value = "env") + private List env; + + /* + * Container resource requirements. + */ + @JsonProperty(value = "resources") + private ContainerResources resources; + + /* + * List of probes for the container. + */ + @JsonProperty(value = "probes") + private List probes; + + /* + * Container volume mounts. + */ + @JsonProperty(value = "volumeMounts") + private List volumeMounts; + + /** + * Get the image property: Container image tag. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: Container image tag. + * + * @param image the image value to set. + * @return the Container object itself. + */ + public Container withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the name property: Custom container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Custom container name. + * + * @param name the name value to set. + * @return the Container object itself. + */ + public Container withName(String name) { + this.name = name; + return this; + } + + /** + * Get the command property: Container start command. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Container start command. + * + * @param command the command value to set. + * @return the Container object itself. + */ + public Container withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the args property: Container start command arguments. + * + * @return the args value. + */ + public List args() { + return this.args; + } + + /** + * Set the args property: Container start command arguments. + * + * @param args the args value to set. + * @return the Container object itself. + */ + public Container withArgs(List args) { + this.args = args; + return this; + } + + /** + * Get the env property: Container environment variables. + * + * @return the env value. + */ + public List env() { + return this.env; + } + + /** + * Set the env property: Container environment variables. + * + * @param env the env value to set. + * @return the Container object itself. + */ + public Container withEnv(List env) { + this.env = env; + return this; + } + + /** + * Get the resources property: Container resource requirements. + * + * @return the resources value. + */ + public ContainerResources resources() { + return this.resources; + } + + /** + * Set the resources property: Container resource requirements. + * + * @param resources the resources value to set. + * @return the Container object itself. + */ + public Container withResources(ContainerResources resources) { + this.resources = resources; + return this; + } + + /** + * 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. + * + * @param probes the probes value to set. + * @return the Container object itself. + */ + public Container withProbes(List probes) { + this.probes = probes; + return this; + } + + /** + * Get the volumeMounts property: Container volume mounts. + * + * @return the volumeMounts value. + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volumeMounts property: Container volume mounts. + * + * @param volumeMounts the volumeMounts value to set. + * @return the Container object itself. + */ + public Container withVolumeMounts(List volumeMounts) { + this.volumeMounts = 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 (probes() != null) { + probes().forEach(e -> e.validate()); + } + if (volumeMounts() != null) { + volumeMounts().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java new file mode 100644 index 0000000000000..fb8281bd39a30 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ContainerApp. */ +public interface ContainerApp { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: managed identities for the Container App to interact with other Azure services + * without maintaining any secrets or credentials in code. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the provisioningState property: Provisioning state of the Container App. + * + * @return the provisioningState value. + */ + ContainerAppProvisioningState provisioningState(); + + /** + * Gets the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @return the managedEnvironmentId value. + */ + String managedEnvironmentId(); + + /** + * Gets the latestRevisionName property: Name of the latest revision of the Container App. + * + * @return the latestRevisionName value. + */ + String latestRevisionName(); + + /** + * Gets the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. + * + * @return the latestRevisionFqdn value. + */ + String latestRevisionFqdn(); + + /** + * Gets the customDomainVerificationId property: Id used to verify domain name ownership. + * + * @return the customDomainVerificationId value. + */ + String customDomainVerificationId(); + + /** + * Gets the configuration property: Non versioned Container App configuration properties. + * + * @return the configuration value. + */ + Configuration configuration(); + + /** + * Gets the template property: Container App versioned application definition. + * + * @return the template value. + */ + Template template(); + + /** + * Gets the outboundIpAddresses property: Outbound IP Addresses for container app. + * + * @return the outboundIpAddresses value. + */ + List outboundIpAddresses(); + + /** + * 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 inner com.azure.resourcemanager.app.fluent.models.ContainerAppInner object. + * + * @return the inner object. + */ + ContainerAppInner innerModel(); + + /** The entirety of the ContainerApp definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ContainerApp definition stages. */ + interface DefinitionStages { + /** The first stage of the ContainerApp definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ContainerApp 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 ContainerApp 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 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.WithIdentity, + DefinitionStages.WithManagedEnvironmentId, + DefinitionStages.WithConfiguration, + DefinitionStages.WithTemplate { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerApp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerApp create(Context context); + } + /** The stage of the ContainerApp 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 ContainerApp definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: managed identities for the Container App to interact with other Azure + * services without maintaining any secrets or credentials in code.. + * + * @param identity managed identities for the Container App to interact with other Azure services without + * maintaining any secrets or credentials in code. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the ContainerApp definition allowing to specify managedEnvironmentId. */ + interface WithManagedEnvironmentId { + /** + * Specifies the managedEnvironmentId property: Resource ID of the Container App's environment.. + * + * @param managedEnvironmentId Resource ID of the Container App's environment. + * @return the next definition stage. + */ + WithCreate withManagedEnvironmentId(String managedEnvironmentId); + } + /** The stage of the ContainerApp definition allowing to specify configuration. */ + interface WithConfiguration { + /** + * Specifies the configuration property: Non versioned Container App configuration properties.. + * + * @param configuration Non versioned Container App configuration properties. + * @return the next definition stage. + */ + WithCreate withConfiguration(Configuration configuration); + } + /** The stage of the ContainerApp definition allowing to specify template. */ + interface WithTemplate { + /** + * Specifies the template property: Container App versioned application definition.. + * + * @param template Container App versioned application definition. + * @return the next definition stage. + */ + WithCreate withTemplate(Template template); + } + } + /** + * Begins update for the ContainerApp resource. + * + * @return the stage of resource update. + */ + ContainerApp.Update update(); + + /** The template for ContainerApp update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerApp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerApp apply(Context context); + } + /** The ContainerApp update stages. */ + interface UpdateStages { + /** The stage of the ContainerApp update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. + * + * @param tags Application-specific metadata in the form of key-value pairs. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContainerApp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerApp refresh(Context context); + + /** + * List secrets for a container app. + * + * @throws com.azure.resourcemanager.app.models.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 Secrets Collection ARM resource. + */ + SecretsCollection listSecrets(); + + /** + * List secrets for a container app. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Secrets Collection ARM resource along with {@link Response}. + */ + Response listSecretsWithResponse(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java new file mode 100644 index 0000000000000..6cc5a7f7e5d31 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App collection ARM resource. */ +@Fluent +public final class ContainerAppCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the ContainerAppCollection object itself. + */ + public ContainerAppCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ContainerAppCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.java new file mode 100644 index 0000000000000..f2a3439d8cfc7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Container App Patch. */ +@Fluent +public final class ContainerAppPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppPatch.class); + + /* + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Application-specific metadata in the form of key-value pairs. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set. + * @return the ContainerAppPatch object itself. + */ + public ContainerAppPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbe.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbe.java new file mode 100644 index 0000000000000..ea24e8f3bc76f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbe.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Probe describes a health check to be performed against a container to determine whether it is alive or ready to + * receive traffic. + */ +@Fluent +public final class ContainerAppProbe { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppProbe.class); + + /* + * Minimum consecutive failures for the probe to be considered failed after + * having succeeded. Defaults to 3. Minimum value is 1. Maximum value is + * 10. + */ + @JsonProperty(value = "failureThreshold") + private Integer failureThreshold; + + /* + * HTTPGet specifies the http request to perform. + */ + @JsonProperty(value = "httpGet") + private ContainerAppProbeHttpGet httpGet; + + /* + * Number of seconds after the container has started before liveness probes + * are initiated. Minimum value is 1. Maximum value is 60. + */ + @JsonProperty(value = "initialDelaySeconds") + private Integer initialDelaySeconds; + + /* + * How often (in seconds) to perform the probe. Default to 10 seconds. + * Minimum value is 1. Maximum value is 240. + */ + @JsonProperty(value = "periodSeconds") + 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. + */ + @JsonProperty(value = "successThreshold") + private Integer successThreshold; + + /* + * TCPSocket specifies an action involving a TCP port. TCP hooks not yet + * supported. + */ + @JsonProperty(value = "tcpSocket") + private ContainerAppProbeTcpSocket tcpSocket; + + /* + * 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) + */ + @JsonProperty(value = "terminationGracePeriodSeconds") + private Long terminationGracePeriodSeconds; + + /* + * Number of seconds after which the probe times out. Defaults to 1 second. + * Minimum value is 1. Maximum value is 240. + */ + @JsonProperty(value = "timeoutSeconds") + private Integer timeoutSeconds; + + /* + * The type of probe. + */ + @JsonProperty(value = "type") + private Type type; + + /** + * 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the httpGet property: HTTPGet specifies the http request to perform. + * + * @return the httpGet value. + */ + public ContainerAppProbeHttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the httpGet property: HTTPGet specifies the http request to perform. + * + * @param httpGet the httpGet value to set. + * @return the ContainerAppProbe object itself. + */ + public ContainerAppProbe withHttpGet(ContainerAppProbeHttpGet httpGet) { + this.httpGet = httpGet; + 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get the tcpSocket property: TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. + * + * @return the tcpSocket value. + */ + public ContainerAppProbeTcpSocket 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe withTcpSocket(ContainerAppProbeTcpSocket tcpSocket) { + this.tcpSocket = tcpSocket; + 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe 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 ContainerAppProbe object itself. + */ + public ContainerAppProbe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Get the type property: The type of probe. + * + * @return the type value. + */ + public Type type() { + return this.type; + } + + /** + * Set the type property: The type of probe. + * + * @param type the type value to set. + * @return the ContainerAppProbe object itself. + */ + public ContainerAppProbe withType(Type type) { + this.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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGet.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGet.java new file mode 100644 index 0000000000000..49e181b3c0d51 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGet.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** HTTPGet specifies the http request to perform. */ +@Fluent +public final class ContainerAppProbeHttpGet { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppProbeHttpGet.class); + + /* + * Host name to connect to, defaults to the pod IP. You probably want to + * set "Host" in httpHeaders instead. + */ + @JsonProperty(value = "host") + private String host; + + /* + * Custom headers to set in the request. HTTP allows repeated headers. + */ + @JsonProperty(value = "httpHeaders") + private List httpHeaders; + + /* + * Path to access on the HTTP server. + */ + @JsonProperty(value = "path") + 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. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /* + * Scheme to use for connecting to the host. Defaults to HTTP. + */ + @JsonProperty(value = "scheme") + private String scheme; + + /** + * 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 ContainerAppProbeHttpGet object itself. + */ + public ContainerAppProbeHttpGet 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 ContainerAppProbeHttpGet object itself. + */ + public ContainerAppProbeHttpGet 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 ContainerAppProbeHttpGet object itself. + */ + public ContainerAppProbeHttpGet 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 ContainerAppProbeHttpGet object itself. + */ + public ContainerAppProbeHttpGet 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 String 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 ContainerAppProbeHttpGet object itself. + */ + public ContainerAppProbeHttpGet withScheme(String scheme) { + this.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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGetHttpHeadersItem.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGetHttpHeadersItem.java new file mode 100644 index 0000000000000..73c017c52a3be --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGetHttpHeadersItem.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HTTPHeader describes a custom header to be used in HTTP probes. */ +@Fluent +public final class ContainerAppProbeHttpGetHttpHeadersItem { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppProbeHttpGetHttpHeadersItem.class); + + /* + * The header field name + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * The header field value + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * 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 ContainerAppProbeHttpGetHttpHeadersItem object itself. + */ + public ContainerAppProbeHttpGetHttpHeadersItem 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 ContainerAppProbeHttpGetHttpHeadersItem object itself. + */ + public ContainerAppProbeHttpGetHttpHeadersItem withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property name in model ContainerAppProbeHttpGetHttpHeadersItem")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ContainerAppProbeHttpGetHttpHeadersItem")); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeTcpSocket.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeTcpSocket.java new file mode 100644 index 0000000000000..7ab7fd97a8264 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeTcpSocket.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. */ +@Fluent +public final class ContainerAppProbeTcpSocket { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppProbeTcpSocket.class); + + /* + * Optional: Host name to connect to, defaults to the pod IP. + */ + @JsonProperty(value = "host") + 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. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * 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 ContainerAppProbeTcpSocket object itself. + */ + public ContainerAppProbeTcpSocket 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 ContainerAppProbeTcpSocket object itself. + */ + public ContainerAppProbeTcpSocket withPort(int port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java new file mode 100644 index 0000000000000..405f2e5ff2fc2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerAppProvisioningState. */ +public final class ContainerAppProvisioningState extends ExpandableStringEnum { + /** Static value InProgress for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ContainerAppProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerAppProvisioningState. + */ + @JsonCreator + public static ContainerAppProvisioningState fromString(String name) { + return fromString(name, ContainerAppProvisioningState.class); + } + + /** @return known ContainerAppProvisioningState values. */ + public static Collection values() { + return values(ContainerAppProvisioningState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppSecret.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppSecret.java new file mode 100644 index 0000000000000..109bd66b7eba5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppSecret.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Secret. */ +@Immutable +public final class ContainerAppSecret { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppSecret.class); + + /* + * Secret Name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Secret Value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java new file mode 100644 index 0000000000000..0970b211a0e4f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerApps. */ +public interface ContainerApps { + /** + * Get the Container Apps in a given subscription. + * + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable list(); + + /** + * Get the Container Apps in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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); + + /** + * Get the Container Apps in a given 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.app.models.DefaultErrorResponseErrorException 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); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App. + */ + ContainerApp getByResourceGroup(String resourceGroupName, String name); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 properties of a Container App along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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 name, Context context); + + /** + * Analyzes a custom hostname 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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain analysis. + */ + CustomHostnameAnalysisResult listCustomHostnameAnalysis(String resourceGroupName, String containerAppName); + + /** + * Analyzes a custom hostname 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 customHostname Custom hostname. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain analysis along with {@link Response}. + */ + Response listCustomHostnameAnalysisWithResponse( + String resourceGroupName, String containerAppName, String customHostname, Context context); + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Secrets Collection ARM resource. + */ + SecretsCollection listSecrets(String resourceGroupName, String name); + + /** + * List secrets for a container app. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.models.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 Secrets Collection ARM resource along with {@link Response}. + */ + Response listSecretsWithResponse(String resourceGroupName, String name, Context context); + + /** + * Get the properties of a Container App. + * + * @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 Container App along with {@link Response}. + */ + ContainerApp getById(String id); + + /** + * Get the properties of a Container App. + * + * @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 Container App along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Description for Delete a Container App. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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); + + /** + * Description for Delete a Container App. + * + * @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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContainerApp resource. + * + * @param name resource name. + * @return the first stage of the new ContainerApp definition. + */ + ContainerApp.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsAuthConfigs.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsAuthConfigs.java new file mode 100644 index 0000000000000..68fa3e7f01456 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsAuthConfigs.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerAppsAuthConfigs. */ +public interface ContainerAppsAuthConfigs { + /** + * 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.app.models.DefaultErrorResponseErrorException 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}. + */ + 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.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); + + /** + * 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 name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 name); + + /** + * 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 name 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.app.models.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}. + */ + Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Description for 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. + * @param name Name of the Container App AuthConfig. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String name); + + /** + * Description for 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. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Get a AuthConfig of a Container App. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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}. + */ + AuthConfig getById(String id); + + /** + * Get a AuthConfig of a Container App. + * + * @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.app.models.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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Description for Delete a Container App AuthConfig. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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); + + /** + * Description for Delete a Container App AuthConfig. + * + * @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.app.models.DefaultErrorResponseErrorException thrown 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 AuthConfig resource. + * + * @param name resource name. + * @return the first stage of the new AuthConfig definition. + */ + AuthConfig.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java new file mode 100644 index 0000000000000..16397f955cd07 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ContainerAppsRevisionReplicas. */ +public interface ContainerAppsRevisionReplicas { + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 replica for a Container App Revision. + */ + Replica getReplica(String resourceGroupName, String containerAppName, String revisionName, String name); + + /** + * Get a replica for 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 name Name of the Container App Revision Replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 replica for a Container App Revision along with {@link Response}. + */ + Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context); + + /** + * List replicas for 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Revision Replicas collection ARM resource. + */ + ReplicaCollection listReplicas(String resourceGroupName, String containerAppName, String revisionName); + + /** + * List replicas for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 Revision Replicas collection ARM resource along with {@link Response}. + */ + Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java new file mode 100644 index 0000000000000..ec812265eadd6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerAppsRevisions. */ +public interface ContainerAppsRevisions { + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable listRevisions(String resourceGroupName, String containerAppName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable listRevisions(String resourceGroupName, String containerAppName, 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + Revision getRevision(String resourceGroupName, String containerAppName, String name); + + /** + * 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 name 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.app.models.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}. + */ + Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Activates a revision 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 activateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Activates a revision 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Deactivates a revision 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 deactivateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Deactivates a revision 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Restarts a revision 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 name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 restartRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Restarts a revision 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 name 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.app.models.DefaultErrorResponseErrorException thrown 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 restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java new file mode 100644 index 0000000000000..1d8758d7e0e4d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerAppsSourceControls. */ +public interface ContainerAppsSourceControls { + /** + * 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.app.models.DefaultErrorResponseErrorException 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}. + */ + 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.app.models.DefaultErrorResponseErrorException 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}. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); + + /** + * 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 name); + + /** + * 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 name 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.app.models.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 name, Context context); + + /** + * Description for 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 name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String name); + + /** + * Description for 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 name 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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Get a SourceControl of a Container App. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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}. + */ + SourceControl getById(String id); + + /** + * Get a SourceControl of a Container App. + * + * @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.app.models.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 getByIdWithResponse(String id, Context context); + + /** + * Description for Delete a Container App SourceControl. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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); + + /** + * Description for Delete a Container App SourceControl. + * + * @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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SourceControl resource. + * + * @param name resource name. + * @return the first stage of the new SourceControl definition. + */ + SourceControl.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.java new file mode 100644 index 0000000000000..c3617239a0d54 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container resource requirements. */ +@Fluent +public final class ContainerResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerResources.class); + + /* + * Required CPU in cores, e.g. 0.5 + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /* + * Required memory, e.g. "250Mb" + */ + @JsonProperty(value = "memory") + private String memory; + + /* + * Ephemeral Storage, e.g. "1Gi" + */ + @JsonProperty(value = "ephemeralStorage", access = JsonProperty.Access.WRITE_ONLY) + private String ephemeralStorage; + + /** + * Get the cpu property: Required CPU in cores, e.g. 0.5. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU in cores, e.g. 0.5. + * + * @param cpu the cpu value to set. + * @return the ContainerResources object itself. + */ + public ContainerResources withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Required memory, e.g. "250Mb". + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Required memory, e.g. "250Mb". + * + * @param memory the memory value to set. + * @return the ContainerResources object itself. + */ + public ContainerResources withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Get the ephemeralStorage property: Ephemeral Storage, e.g. "1Gi". + * + * @return the ephemeralStorage value. + */ + public String ephemeralStorage() { + return this.ephemeralStorage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomDomain.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomDomain.java new file mode 100644 index 0000000000000..eb26245dd9dee --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomDomain.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom Domain of a Container App. */ +@Fluent +public final class CustomDomain { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomain.class); + + /* + * Hostname. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Custom Domain binding type. + */ + @JsonProperty(value = "bindingType") + private BindingType bindingType; + + /* + * Resource Id of the Certificate to be bound to this hostname. Must exist + * in the Managed Environment. + */ + @JsonProperty(value = "certificateId") + private String certificateId; + + /** + * Get the name property: Hostname. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Hostname. + * + * @param name the name value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withName(String name) { + this.name = name; + return this; + } + + /** + * Get the bindingType property: Custom Domain binding type. + * + * @return the bindingType value. + */ + public BindingType bindingType() { + return this.bindingType; + } + + /** + * Set the bindingType property: Custom Domain binding type. + * + * @param bindingType the bindingType value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withBindingType(BindingType bindingType) { + this.bindingType = bindingType; + return this; + } + + /** + * Get the certificateId property: Resource Id of the Certificate to be bound to this hostname. Must exist in the + * Managed Environment. + * + * @return the certificateId value. + */ + public String certificateId() { + return this.certificateId; + } + + /** + * Set the certificateId property: Resource Id of the Certificate to be bound to this hostname. Must exist in the + * Managed Environment. + * + * @param certificateId the certificateId value to set. + * @return the CustomDomain object itself. + */ + public CustomDomain withCertificateId(String certificateId) { + this.certificateId = certificateId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomHostnameAnalysisResult.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomHostnameAnalysisResult.java new file mode 100644 index 0000000000000..266db63a3bfec --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomHostnameAnalysisResult.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.CustomHostnameAnalysisResultInner; +import java.util.List; + +/** An immutable client-side representation of CustomHostnameAnalysisResult. */ +public interface CustomHostnameAnalysisResult { + /** + * 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 hostname property: Host name that was analyzed. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the isHostnameAlreadyVerified property: <code>true</code> if hostname is already verified; + * otherwise, <code>false</code>. + * + * @return the isHostnameAlreadyVerified value. + */ + Boolean isHostnameAlreadyVerified(); + + /** + * Gets the customDomainVerificationTest property: DNS verification test result. + * + * @return the customDomainVerificationTest value. + */ + DnsVerificationTestResult customDomainVerificationTest(); + + /** + * Gets the customDomainVerificationFailureInfo property: Raw failure information if DNS verification fails. + * + * @return the customDomainVerificationFailureInfo value. + */ + DefaultErrorResponseError customDomainVerificationFailureInfo(); + + /** + * Gets the hasConflictOnManagedEnvironment property: <code>true</code> if there is a conflict on the + * Container App's managed environment; otherwise, <code>false</code>. + * + * @return the hasConflictOnManagedEnvironment value. + */ + Boolean hasConflictOnManagedEnvironment(); + + /** + * Gets the conflictingContainerAppResourceId property: Name of the conflicting Container App on the Managed + * Environment if it's within the same subscription. + * + * @return the conflictingContainerAppResourceId value. + */ + String conflictingContainerAppResourceId(); + + /** + * Gets the cNameRecords property: CName records visible for this hostname. + * + * @return the cNameRecords value. + */ + List cNameRecords(); + + /** + * Gets the txtRecords property: TXT records visible for this hostname. + * + * @return the txtRecords value. + */ + List txtRecords(); + + /** + * Gets the aRecords property: A records visible for this hostname. + * + * @return the aRecords value. + */ + List aRecords(); + + /** + * Gets the alternateCNameRecords property: Alternate CName records visible for this hostname. + * + * @return the alternateCNameRecords value. + */ + List alternateCNameRecords(); + + /** + * Gets the alternateTxtRecords property: Alternate TXT records visible for this hostname. + * + * @return the alternateTxtRecords value. + */ + List alternateTxtRecords(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.CustomHostnameAnalysisResultInner object. + * + * @return the inner object. + */ + CustomHostnameAnalysisResultInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomOpenIdConnectProvider.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomOpenIdConnectProvider.java new file mode 100644 index 0000000000000..70689a5ed1761 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomOpenIdConnectProvider.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the custom Open ID Connect provider. */ +@Fluent +public final class CustomOpenIdConnectProvider { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomOpenIdConnectProvider.class); + + /* + * Disabled if the custom Open ID Connect provider should not + * be enabled despite the set registration; otherwise, + * Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the app registration for the custom Open + * ID Connect provider. + */ + @JsonProperty(value = "registration") + private OpenIdConnectRegistration registration; + + /* + * The configuration settings of the login flow of the custom Open ID + * Connect provider. + */ + @JsonProperty(value = "login") + private OpenIdConnectLogin login; + + /** + * Get the state property: <code>Disabled</code> if the custom Open ID Connect provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the custom Open ID Connect provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the CustomOpenIdConnectProvider object itself. + */ + public CustomOpenIdConnectProvider withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the app registration for the custom Open ID Connect + * provider. + * + * @return the registration value. + */ + public OpenIdConnectRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the app registration for the custom Open ID Connect + * provider. + * + * @param registration the registration value to set. + * @return the CustomOpenIdConnectProvider object itself. + */ + public CustomOpenIdConnectProvider withRegistration(OpenIdConnectRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow of the custom Open ID Connect provider. + * + * @return the login value. + */ + public OpenIdConnectLogin login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow of the custom Open ID Connect provider. + * + * @param login the login value to set. + * @return the CustomOpenIdConnectProvider object itself. + */ + public CustomOpenIdConnectProvider withLogin(OpenIdConnectLogin login) { + this.login = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java new file mode 100644 index 0000000000000..e31ca37dc5fe6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App container Custom scaling rule. */ +@Fluent +public final class CustomScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomScaleRule.class); + + /* + * Type of the custom scale rule + * eg: azure-servicebus, redis etc. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Metadata properties to describe custom scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the custom scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** + * Get the type property: Type of the custom scale rule eg: azure-servicebus, redis etc. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the custom scale rule eg: azure-servicebus, redis etc. + * + * @param type the type value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withType(String type) { + this.type = type; + return this; + } + + /** + * Get the metadata property: Metadata properties to describe custom scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe custom scale rule. + * + * @param metadata the metadata value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the custom scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the custom scale rule. + * + * @param auth the auth value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withAuth(List auth) { + this.auth = auth; + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java new file mode 100644 index 0000000000000..2ef96f1c69c19 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Dapr configuration. */ +@Fluent +public final class Dapr { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dapr.class); + + /* + * Boolean indicating if the Dapr side car is enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Dapr application identifier + */ + @JsonProperty(value = "appId") + private String appId; + + /* + * Tells Dapr which protocol your application is using. Valid options are + * http and grpc. Default is http + */ + @JsonProperty(value = "appProtocol") + private AppProtocol appProtocol; + + /* + * Tells Dapr which port your application is listening on + */ + @JsonProperty(value = "appPort") + private Integer appPort; + + /** + * Get the enabled property: Boolean indicating if the Dapr side car is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Boolean indicating if the Dapr side car is enabled. + * + * @param enabled the enabled value to set. + * @return the Dapr object itself. + */ + public Dapr withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the appId property: Dapr application identifier. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId property: Dapr application identifier. + * + * @param appId the appId value to set. + * @return the Dapr object itself. + */ + public Dapr withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the appProtocol property: Tells Dapr which protocol your application is using. Valid options are http and + * grpc. Default is http. + * + * @return the appProtocol value. + */ + public AppProtocol appProtocol() { + return this.appProtocol; + } + + /** + * Set the appProtocol property: Tells Dapr which protocol your application is using. Valid options are http and + * grpc. Default is http. + * + * @param appProtocol the appProtocol value to set. + * @return the Dapr object itself. + */ + public Dapr withAppProtocol(AppProtocol appProtocol) { + this.appProtocol = appProtocol; + return this; + } + + /** + * Get the appPort property: Tells Dapr which port your application is listening on. + * + * @return the appPort value. + */ + public Integer appPort() { + return this.appPort; + } + + /** + * Set the appPort property: Tells Dapr which port your application is listening on. + * + * @param appPort the appPort value to set. + * @return the Dapr object itself. + */ + public Dapr withAppPort(Integer appPort) { + this.appPort = appPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponent.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponent.java new file mode 100644 index 0000000000000..b12e142bdc0f2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponent.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import java.util.List; + +/** An immutable client-side representation of DaprComponent. */ +public interface DaprComponent { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the componentType property: Component type. + * + * @return the componentType value. + */ + String componentType(); + + /** + * Gets the version property: Component version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @return the ignoreErrors value. + */ + Boolean ignoreErrors(); + + /** + * Gets the initTimeout property: Initialization timeout. + * + * @return the initTimeout value. + */ + String initTimeout(); + + /** + * Gets the secrets property: Collection of secrets used by a Dapr component. + * + * @return the secrets value. + */ + List secrets(); + + /** + * Gets the metadata property: Component metadata. + * + * @return the metadata value. + */ + List metadata(); + + /** + * Gets the scopes property: Names of container apps that can use this Dapr component. + * + * @return the scopes value. + */ + List scopes(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.DaprComponentInner object. + * + * @return the inner object. + */ + DaprComponentInner innerModel(); + + /** The entirety of the DaprComponent definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DaprComponent definition stages. */ + interface DefinitionStages { + /** The first stage of the DaprComponent definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DaprComponent 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 DaprComponent definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithComponentType, + DefinitionStages.WithVersion, + DefinitionStages.WithIgnoreErrors, + DefinitionStages.WithInitTimeout, + DefinitionStages.WithSecrets, + DefinitionStages.WithMetadata, + DefinitionStages.WithScopes { + /** + * Executes the create request. + * + * @return the created resource. + */ + DaprComponent create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DaprComponent create(Context context); + } + /** The stage of the DaprComponent definition allowing to specify componentType. */ + interface WithComponentType { + /** + * Specifies the componentType property: Component type. + * + * @param componentType Component type. + * @return the next definition stage. + */ + WithCreate withComponentType(String componentType); + } + /** The stage of the DaprComponent definition allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Component version. + * + * @param version Component version. + * @return the next definition stage. + */ + WithCreate withVersion(String version); + } + /** The stage of the DaprComponent definition allowing to specify ignoreErrors. */ + interface WithIgnoreErrors { + /** + * Specifies the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @param ignoreErrors Boolean describing if the component errors are ignores. + * @return the next definition stage. + */ + WithCreate withIgnoreErrors(Boolean ignoreErrors); + } + /** The stage of the DaprComponent definition allowing to specify initTimeout. */ + interface WithInitTimeout { + /** + * Specifies the initTimeout property: Initialization timeout. + * + * @param initTimeout Initialization timeout. + * @return the next definition stage. + */ + WithCreate withInitTimeout(String initTimeout); + } + /** The stage of the DaprComponent definition allowing to specify secrets. */ + interface WithSecrets { + /** + * Specifies the secrets property: Collection of secrets used by a Dapr component. + * + * @param secrets Collection of secrets used by a Dapr component. + * @return the next definition stage. + */ + WithCreate withSecrets(List secrets); + } + /** The stage of the DaprComponent definition allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Component metadata. + * + * @param metadata Component metadata. + * @return the next definition stage. + */ + WithCreate withMetadata(List metadata); + } + /** The stage of the DaprComponent definition allowing to specify scopes. */ + interface WithScopes { + /** + * Specifies the scopes property: Names of container apps that can use this Dapr component. + * + * @param scopes Names of container apps that can use this Dapr component. + * @return the next definition stage. + */ + WithCreate withScopes(List scopes); + } + } + /** + * Begins update for the DaprComponent resource. + * + * @return the stage of resource update. + */ + DaprComponent.Update update(); + + /** The template for DaprComponent update. */ + interface Update + extends UpdateStages.WithComponentType, + UpdateStages.WithVersion, + UpdateStages.WithIgnoreErrors, + UpdateStages.WithInitTimeout, + UpdateStages.WithSecrets, + UpdateStages.WithMetadata, + UpdateStages.WithScopes { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DaprComponent apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DaprComponent apply(Context context); + } + /** The DaprComponent update stages. */ + interface UpdateStages { + /** The stage of the DaprComponent update allowing to specify componentType. */ + interface WithComponentType { + /** + * Specifies the componentType property: Component type. + * + * @param componentType Component type. + * @return the next definition stage. + */ + Update withComponentType(String componentType); + } + /** The stage of the DaprComponent update allowing to specify version. */ + interface WithVersion { + /** + * Specifies the version property: Component version. + * + * @param version Component version. + * @return the next definition stage. + */ + Update withVersion(String version); + } + /** The stage of the DaprComponent update allowing to specify ignoreErrors. */ + interface WithIgnoreErrors { + /** + * Specifies the ignoreErrors property: Boolean describing if the component errors are ignores. + * + * @param ignoreErrors Boolean describing if the component errors are ignores. + * @return the next definition stage. + */ + Update withIgnoreErrors(Boolean ignoreErrors); + } + /** The stage of the DaprComponent update allowing to specify initTimeout. */ + interface WithInitTimeout { + /** + * Specifies the initTimeout property: Initialization timeout. + * + * @param initTimeout Initialization timeout. + * @return the next definition stage. + */ + Update withInitTimeout(String initTimeout); + } + /** The stage of the DaprComponent update allowing to specify secrets. */ + interface WithSecrets { + /** + * Specifies the secrets property: Collection of secrets used by a Dapr component. + * + * @param secrets Collection of secrets used by a Dapr component. + * @return the next definition stage. + */ + Update withSecrets(List secrets); + } + /** The stage of the DaprComponent update allowing to specify metadata. */ + interface WithMetadata { + /** + * Specifies the metadata property: Component metadata. + * + * @param metadata Component metadata. + * @return the next definition stage. + */ + Update withMetadata(List metadata); + } + /** The stage of the DaprComponent update allowing to specify scopes. */ + interface WithScopes { + /** + * Specifies the scopes property: Names of container apps that can use this Dapr component. + * + * @param scopes Names of container apps that can use this Dapr component. + * @return the next definition stage. + */ + Update withScopes(List scopes); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DaprComponent refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DaprComponent refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponents.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponents.java new file mode 100644 index 0000000000000..e7ba4d6bec37b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponents.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 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.app.models.DefaultErrorResponseErrorException 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.app.models.DefaultErrorResponseErrorException 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + DaprComponent get(String resourceGroupName, String environmentName, String name); + + /** + * Get a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param name Name of the Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String environmentName, String name, Context context); + + /** + * Delete a Dapr 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 Dapr Component. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String environmentName, String name); + + /** + * Delete a Dapr 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 Dapr Component. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String environmentName, String name, Context context); + + /** + * Get a dapr component. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 along with {@link Response}. + */ + DaprComponent getById(String id); + + /** + * Get 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.app.models.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 along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Dapr Component from a Managed Environment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 from a Managed Environment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown 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 DaprComponent resource. + * + * @param name resource name. + * @return the first stage of the new DaprComponent definition. + */ + DaprComponent.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponentsCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponentsCollection.java new file mode 100644 index 0000000000000..2769c1dd2c889 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponentsCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr Components ARM resource. */ +@Fluent +public final class DaprComponentsCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DaprComponentsCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the DaprComponentsCollection object itself. + */ + public DaprComponentsCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DaprComponentsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprMetadata.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprMetadata.java new file mode 100644 index 0000000000000..d399d6342016d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprMetadata.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dapr component metadata. */ +@Fluent +public final class DaprMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DaprMetadata.class); + + /* + * Metadata property name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Metadata property value. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Name of the Dapr Component secret from which to pull the metadata + * property value. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /** + * Get the name property: Metadata property name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metadata property name. + * + * @param name the name value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Metadata property value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Metadata property value. + * + * @param value the value value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the secretRef property: Name of the Dapr Component secret from which to pull the metadata property value. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: Name of the Dapr Component secret from which to pull the metadata property value. + * + * @param secretRef the secretRef value to set. + * @return the DaprMetadata object itself. + */ + public DaprMetadata withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java new file mode 100644 index 0000000000000..1495df5758df0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** App Service error response. */ +@Immutable +public final class DefaultErrorResponseError extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultErrorResponseError.class); + + /* + * More information to debug error. + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private String innererror; + + /** + * Get the innererror property: More information to debug error. + * + * @return the innererror value. + */ + public String getInnererror() { + return this.innererror; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.java new file mode 100644 index 0000000000000..f1b5e9cdef0e9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with DefaultErrorResponseError information. */ +public final class DefaultErrorResponseErrorException extends ManagementException { + /** + * Initializes a new instance of the DefaultErrorResponseErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public DefaultErrorResponseErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the DefaultErrorResponseErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public DefaultErrorResponseErrorException(String message, HttpResponse response, DefaultErrorResponseError value) { + super(message, response, value); + } + + @Override + public DefaultErrorResponseError getValue() { + return (DefaultErrorResponseError) super.getValue(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DisableWwwAuthenticateMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DisableWwwAuthenticateMode.java new file mode 100644 index 0000000000000..948de4c707c89 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DisableWwwAuthenticateMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DisableWwwAuthenticateMode. */ +public final class DisableWwwAuthenticateMode extends ExpandableStringEnum { + /** Static value True for DisableWwwAuthenticateMode. */ + public static final DisableWwwAuthenticateMode TRUE = fromString("True"); + + /** Static value False for DisableWwwAuthenticateMode. */ + public static final DisableWwwAuthenticateMode FALSE = fromString("False"); + + /** + * Creates or finds a DisableWwwAuthenticateMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DisableWwwAuthenticateMode. + */ + @JsonCreator + public static DisableWwwAuthenticateMode fromString(String name) { + return fromString(name, DisableWwwAuthenticateMode.class); + } + + /** @return known DisableWwwAuthenticateMode values. */ + public static Collection values() { + return values(DisableWwwAuthenticateMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DnsVerificationTestResult.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DnsVerificationTestResult.java new file mode 100644 index 0000000000000..9e187f8655f69 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DnsVerificationTestResult.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for DnsVerificationTestResult. */ +public enum DnsVerificationTestResult { + /** Enum value Passed. */ + PASSED("Passed"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Skipped. */ + SKIPPED("Skipped"); + + /** The actual serialized value for a DnsVerificationTestResult instance. */ + private final String value; + + DnsVerificationTestResult(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DnsVerificationTestResult instance. + * + * @param value the serialized value to parse. + * @return the parsed DnsVerificationTestResult object, or null if unable to parse. + */ + @JsonCreator + public static DnsVerificationTestResult fromString(String value) { + DnsVerificationTestResult[] items = DnsVerificationTestResult.values(); + for (DnsVerificationTestResult item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EasyAuthState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EasyAuthState.java new file mode 100644 index 0000000000000..d0fa615ec747e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EasyAuthState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EasyAuthState. */ +public final class EasyAuthState extends ExpandableStringEnum { + /** Static value Enabled for EasyAuthState. */ + public static final EasyAuthState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EasyAuthState. */ + public static final EasyAuthState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a EasyAuthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EasyAuthState. + */ + @JsonCreator + public static EasyAuthState fromString(String name) { + return fromString(name, EasyAuthState.class); + } + + /** @return known EasyAuthState values. */ + public static Collection values() { + return values(EasyAuthState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java new file mode 100644 index 0000000000000..f438babe8ad75 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnvironmentProvisioningState. */ +public final class EnvironmentProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Waiting for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState WAITING = fromString("Waiting"); + + /** Static value InitializationInProgress for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState INITIALIZATION_IN_PROGRESS = + fromString("InitializationInProgress"); + + /** Static value InfrastructureSetupInProgress for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState INFRASTRUCTURE_SETUP_IN_PROGRESS = + fromString("InfrastructureSetupInProgress"); + + /** Static value InfrastructureSetupComplete for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState INFRASTRUCTURE_SETUP_COMPLETE = + fromString("InfrastructureSetupComplete"); + + /** Static value ScheduledForDelete for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState SCHEDULED_FOR_DELETE = fromString("ScheduledForDelete"); + + /** Static value UpgradeRequested for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState UPGRADE_REQUESTED = fromString("UpgradeRequested"); + + /** Static value UpgradeFailed for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState UPGRADE_FAILED = fromString("UpgradeFailed"); + + /** + * Creates or finds a EnvironmentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentProvisioningState. + */ + @JsonCreator + public static EnvironmentProvisioningState fromString(String name) { + return fromString(name, EnvironmentProvisioningState.class); + } + + /** @return known EnvironmentProvisioningState values. */ + public static Collection values() { + return values(EnvironmentProvisioningState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java new file mode 100644 index 0000000000000..39b20073f4927 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container environment variable. */ +@Fluent +public final class EnvironmentVar { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentVar.class); + + /* + * Environment variable name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Non-secret environment variable value. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Name of the Container App secret from which to pull the environment + * variable value. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /** + * Get the name property: Environment variable name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Environment variable name. + * + * @param name the name value to set. + * @return the EnvironmentVar object itself. + */ + public EnvironmentVar withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Non-secret environment variable value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Non-secret environment variable value. + * + * @param value the value value to set. + * @return the EnvironmentVar object itself. + */ + public EnvironmentVar withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the secretRef property: Name of the Container App secret from which to pull the environment variable value. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: Name of the Container App secret from which to pull the environment variable value. + * + * @param secretRef the secretRef value to set. + * @return the EnvironmentVar object itself. + */ + public EnvironmentVar withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Facebook.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Facebook.java new file mode 100644 index 0000000000000..fdb71a72bd47f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Facebook.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Facebook provider. */ +@Fluent +public final class Facebook { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Facebook.class); + + /* + * Disabled if the Facebook provider should not be enabled + * despite the set registration; otherwise, Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the app registration for the Facebook + * provider. + */ + @JsonProperty(value = "registration") + private AppRegistration registration; + + /* + * The version of the Facebook api to be used while logging in. + */ + @JsonProperty(value = "graphApiVersion") + private String graphApiVersion; + + /* + * The configuration settings of the login flow. + */ + @JsonProperty(value = "login") + private LoginScopes login; + + /** + * Get the state property: <code>Disabled</code> if the Facebook provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the Facebook provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the Facebook object itself. + */ + public Facebook withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the app registration for the Facebook provider. + * + * @return the registration value. + */ + public AppRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the app registration for the Facebook provider. + * + * @param registration the registration value to set. + * @return the Facebook object itself. + */ + public Facebook withRegistration(AppRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the graphApiVersion property: The version of the Facebook api to be used while logging in. + * + * @return the graphApiVersion value. + */ + public String graphApiVersion() { + return this.graphApiVersion; + } + + /** + * Set the graphApiVersion property: The version of the Facebook api to be used while logging in. + * + * @param graphApiVersion the graphApiVersion value to set. + * @return the Facebook object itself. + */ + public Facebook withGraphApiVersion(String graphApiVersion) { + this.graphApiVersion = graphApiVersion; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow. + * + * @return the login value. + */ + public LoginScopes login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow. + * + * @param login the login value to set. + * @return the Facebook object itself. + */ + public Facebook withLogin(LoginScopes login) { + this.login = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GitHub.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GitHub.java new file mode 100644 index 0000000000000..b15fb204779e8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GitHub.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the GitHub provider. */ +@Fluent +public final class GitHub { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GitHub.class); + + /* + * Disabled if the GitHub provider should not be enabled + * despite the set registration; otherwise, Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the app registration for the GitHub + * provider. + */ + @JsonProperty(value = "registration") + private ClientRegistration registration; + + /* + * The configuration settings of the login flow. + */ + @JsonProperty(value = "login") + private LoginScopes login; + + /** + * Get the state property: <code>Disabled</code> if the GitHub provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the GitHub provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the GitHub object itself. + */ + public GitHub withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the app registration for the GitHub provider. + * + * @return the registration value. + */ + public ClientRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the app registration for the GitHub provider. + * + * @param registration the registration value to set. + * @return the GitHub object itself. + */ + public GitHub withRegistration(ClientRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow. + * + * @return the login value. + */ + public LoginScopes login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow. + * + * @param login the login value to set. + * @return the GitHub object itself. + */ + public GitHub withLogin(LoginScopes login) { + this.login = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java new file mode 100644 index 0000000000000..c8a10bff61f0a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties that define the mutable settings of a Container App SourceControl. */ +@Fluent +public final class GithubActionConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GithubActionConfiguration.class); + + /* + * Registry configurations. + */ + @JsonProperty(value = "registryInfo") + private RegistryInfo registryInfo; + + /* + * AzureCredentials configurations. + */ + @JsonProperty(value = "azureCredentials") + private AzureCredentials azureCredentials; + + /* + * Docker file path + */ + @JsonProperty(value = "dockerfilePath") + private String dockerfilePath; + + /* + * Code or Image + */ + @JsonProperty(value = "publishType") + private String publishType; + + /* + * Operation system + */ + @JsonProperty(value = "os") + private String os; + + /* + * Runtime stack + */ + @JsonProperty(value = "runtimeStack") + private String runtimeStack; + + /* + * Runtime Version + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /** + * Get the registryInfo property: Registry configurations. + * + * @return the registryInfo value. + */ + public RegistryInfo registryInfo() { + return this.registryInfo; + } + + /** + * Set the registryInfo property: Registry configurations. + * + * @param registryInfo the registryInfo value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withRegistryInfo(RegistryInfo registryInfo) { + this.registryInfo = registryInfo; + return this; + } + + /** + * Get the azureCredentials property: AzureCredentials configurations. + * + * @return the azureCredentials value. + */ + public AzureCredentials azureCredentials() { + return this.azureCredentials; + } + + /** + * Set the azureCredentials property: AzureCredentials configurations. + * + * @param azureCredentials the azureCredentials value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withAzureCredentials(AzureCredentials azureCredentials) { + this.azureCredentials = azureCredentials; + return this; + } + + /** + * Get the dockerfilePath property: Docker file path. + * + * @return the dockerfilePath value. + */ + public String dockerfilePath() { + return this.dockerfilePath; + } + + /** + * Set the dockerfilePath property: Docker file path. + * + * @param dockerfilePath the dockerfilePath value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withDockerfilePath(String dockerfilePath) { + this.dockerfilePath = dockerfilePath; + return this; + } + + /** + * Get the publishType property: Code or Image. + * + * @return the publishType value. + */ + public String publishType() { + return this.publishType; + } + + /** + * Set the publishType property: Code or Image. + * + * @param publishType the publishType value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withPublishType(String publishType) { + this.publishType = publishType; + return this; + } + + /** + * Get the os property: Operation system. + * + * @return the os value. + */ + public String os() { + return this.os; + } + + /** + * Set the os property: Operation system. + * + * @param os the os value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withOs(String os) { + this.os = os; + return this; + } + + /** + * Get the runtimeStack property: Runtime stack. + * + * @return the runtimeStack value. + */ + public String runtimeStack() { + return this.runtimeStack; + } + + /** + * Set the runtimeStack property: Runtime stack. + * + * @param runtimeStack the runtimeStack value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withRuntimeStack(String runtimeStack) { + this.runtimeStack = runtimeStack; + return this; + } + + /** + * Get the runtimeVersion property: Runtime Version. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime Version. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GlobalValidation.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GlobalValidation.java new file mode 100644 index 0000000000000..fd4a89fd67349 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GlobalValidation.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration settings that determines the validation flow of users using ContainerApp + * Authentication/Authorization. + */ +@Fluent +public final class GlobalValidation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GlobalValidation.class); + + /* + * The action to take when an unauthenticated client attempts to access the + * app. + */ + @JsonProperty(value = "unauthenticatedClientAction") + private UnauthenticatedClientAction unauthenticatedClientAction; + + /* + * The default authentication provider to use when multiple providers are + * configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". + */ + @JsonProperty(value = "redirectToProvider") + private String redirectToProvider; + + /** + * Get the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to + * access the app. + * + * @return the unauthenticatedClientAction value. + */ + public UnauthenticatedClientAction unauthenticatedClientAction() { + return this.unauthenticatedClientAction; + } + + /** + * Set the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to + * access the app. + * + * @param unauthenticatedClientAction the unauthenticatedClientAction value to set. + * @return the GlobalValidation object itself. + */ + public GlobalValidation withUnauthenticatedClientAction(UnauthenticatedClientAction unauthenticatedClientAction) { + this.unauthenticatedClientAction = unauthenticatedClientAction; + return this; + } + + /** + * Get the redirectToProvider property: The default authentication provider to use when multiple providers are + * configured. This setting is only needed if multiple providers are configured and the unauthenticated client + * action is set to "RedirectToLoginPage". + * + * @return the redirectToProvider value. + */ + public String redirectToProvider() { + return this.redirectToProvider; + } + + /** + * Set the redirectToProvider property: The default authentication provider to use when multiple providers are + * configured. This setting is only needed if multiple providers are configured and the unauthenticated client + * action is set to "RedirectToLoginPage". + * + * @param redirectToProvider the redirectToProvider value to set. + * @return the GlobalValidation object itself. + */ + public GlobalValidation withRedirectToProvider(String redirectToProvider) { + this.redirectToProvider = redirectToProvider; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Google.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Google.java new file mode 100644 index 0000000000000..e475bb8763eea --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Google.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Google provider. */ +@Fluent +public final class Google { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Google.class); + + /* + * Disabled if the Google provider should not be enabled + * despite the set registration; otherwise, Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the app registration for the Google + * provider. + */ + @JsonProperty(value = "registration") + private ClientRegistration registration; + + /* + * The configuration settings of the login flow. + */ + @JsonProperty(value = "login") + private LoginScopes login; + + /* + * The configuration settings of the Azure Active Directory token + * validation flow. + */ + @JsonProperty(value = "validation") + private AllowedAudiencesValidation validation; + + /** + * Get the state property: <code>Disabled</code> if the Google provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the Google provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the Google object itself. + */ + public Google withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the app registration for the Google provider. + * + * @return the registration value. + */ + public ClientRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the app registration for the Google provider. + * + * @param registration the registration value to set. + * @return the Google object itself. + */ + public Google withRegistration(ClientRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow. + * + * @return the login value. + */ + public LoginScopes login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow. + * + * @param login the login value to set. + * @return the Google object itself. + */ + public Google withLogin(LoginScopes login) { + this.login = login; + return this; + } + + /** + * Get the validation property: The configuration settings of the Azure Active Directory token validation flow. + * + * @return the validation value. + */ + public AllowedAudiencesValidation validation() { + return this.validation; + } + + /** + * Set the validation property: The configuration settings of the Azure Active Directory token validation flow. + * + * @param validation the validation value to set. + * @return the Google object itself. + */ + public Google withValidation(AllowedAudiencesValidation validation) { + this.validation = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java new file mode 100644 index 0000000000000..3fff401b91f8f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App container Custom scaling rule. */ +@Fluent +public final class HttpScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpScaleRule.class); + + /* + * Metadata properties to describe http scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the custom scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** + * Get the metadata property: Metadata properties to describe http scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe http scale rule. + * + * @param metadata the metadata value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the custom scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the custom scale rule. + * + * @param auth the auth value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withAuth(List auth) { + this.auth = auth; + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettings.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettings.java new file mode 100644 index 0000000000000..9d8abf8114761 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettings.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration settings of the HTTP requests for authentication and authorization requests made against + * ContainerApp Authentication/Authorization. + */ +@Fluent +public final class HttpSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpSettings.class); + + /* + * false if the authentication/authorization responses not + * having the HTTPS scheme are permissible; otherwise, true. + */ + @JsonProperty(value = "requireHttps") + private RequireHttpsMode requireHttps; + + /* + * The configuration settings of the paths HTTP requests. + */ + @JsonProperty(value = "route") + private HttpSettingsRoute route; + + /** + * Get the requireHttps property: <code>false</code> if the authentication/authorization responses not + * having the HTTPS scheme are permissible; otherwise, <code>true</code>. + * + * @return the requireHttps value. + */ + public RequireHttpsMode requireHttps() { + return this.requireHttps; + } + + /** + * Set the requireHttps property: <code>false</code> if the authentication/authorization responses not + * having the HTTPS scheme are permissible; otherwise, <code>true</code>. + * + * @param requireHttps the requireHttps value to set. + * @return the HttpSettings object itself. + */ + public HttpSettings withRequireHttps(RequireHttpsMode requireHttps) { + this.requireHttps = requireHttps; + return this; + } + + /** + * Get the route property: The configuration settings of the paths HTTP requests. + * + * @return the route value. + */ + public HttpSettingsRoute route() { + return this.route; + } + + /** + * Set the route property: The configuration settings of the paths HTTP requests. + * + * @param route the route value to set. + * @return the HttpSettings object itself. + */ + public HttpSettings withRoute(HttpSettingsRoute route) { + this.route = route; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (route() != null) { + route().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoute.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoute.java new file mode 100644 index 0000000000000..55f265ceb259e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoute.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the paths HTTP requests. */ +@Fluent +public final class HttpSettingsRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpSettingsRoute.class); + + /* + * The prefix that should precede all the authentication/authorization + * paths. + */ + @JsonProperty(value = "apiPrefix") + private String apiPrefix; + + /** + * Get the apiPrefix property: The prefix that should precede all the authentication/authorization paths. + * + * @return the apiPrefix value. + */ + public String apiPrefix() { + return this.apiPrefix; + } + + /** + * Set the apiPrefix property: The prefix that should precede all the authentication/authorization paths. + * + * @param apiPrefix the apiPrefix value to set. + * @return the HttpSettingsRoute object itself. + */ + public HttpSettingsRoute withApiPrefix(String apiPrefix) { + this.apiPrefix = apiPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviderState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviderState.java new file mode 100644 index 0000000000000..ee7c7231ff225 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviderState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IdentityProviderState. */ +public final class IdentityProviderState extends ExpandableStringEnum { + /** Static value Enabled for IdentityProviderState. */ + public static final IdentityProviderState ENABLED = fromString("Enabled"); + + /** Static value Disabled for IdentityProviderState. */ + public static final IdentityProviderState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a IdentityProviderState from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityProviderState. + */ + @JsonCreator + public static IdentityProviderState fromString(String name) { + return fromString(name, IdentityProviderState.class); + } + + /** @return known IdentityProviderState values. */ + public static Collection values() { + return values(IdentityProviderState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviders.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviders.java new file mode 100644 index 0000000000000..c72f5ee13ebe3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviders.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** + * The configuration settings of each of the identity providers used to configure ContainerApp + * Authentication/Authorization. + */ +@Fluent +public final class IdentityProviders { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityProviders.class); + + /* + * The configuration settings of the Azure Active directory provider. + */ + @JsonProperty(value = "azureActiveDirectory") + private AzureActiveDirectory azureActiveDirectory; + + /* + * The configuration settings of the Facebook provider. + */ + @JsonProperty(value = "facebook") + private Facebook facebook; + + /* + * The configuration settings of the GitHub provider. + */ + @JsonProperty(value = "gitHub") + private GitHub gitHub; + + /* + * The configuration settings of the Google provider. + */ + @JsonProperty(value = "google") + private Google google; + + /* + * The configuration settings of the legacy Microsoft Account provider. + */ + @JsonProperty(value = "legacyMicrosoftAccount") + private LegacyMicrosoftAccount legacyMicrosoftAccount; + + /* + * The configuration settings of the Twitter provider. + */ + @JsonProperty(value = "twitter") + private Twitter twitter; + + /* + * The configuration settings of the Apple provider. + */ + @JsonProperty(value = "apple") + private Apple apple; + + /* + * The configuration settings of the Azure Static Web Apps provider. + */ + @JsonProperty(value = "azureStaticWebApp") + private AzureStaticWebApp azureStaticWebApp; + + /* + * The map of the name of the alias of each custom Open ID Connect provider + * to the + * configuration settings of the custom Open ID Connect provider. + */ + @JsonProperty(value = "customOpenIdConnectProviders") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map customOpenIdConnectProviders; + + /** + * Get the azureActiveDirectory property: The configuration settings of the Azure Active directory provider. + * + * @return the azureActiveDirectory value. + */ + public AzureActiveDirectory azureActiveDirectory() { + return this.azureActiveDirectory; + } + + /** + * Set the azureActiveDirectory property: The configuration settings of the Azure Active directory provider. + * + * @param azureActiveDirectory the azureActiveDirectory value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withAzureActiveDirectory(AzureActiveDirectory azureActiveDirectory) { + this.azureActiveDirectory = azureActiveDirectory; + return this; + } + + /** + * Get the facebook property: The configuration settings of the Facebook provider. + * + * @return the facebook value. + */ + public Facebook facebook() { + return this.facebook; + } + + /** + * Set the facebook property: The configuration settings of the Facebook provider. + * + * @param facebook the facebook value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withFacebook(Facebook facebook) { + this.facebook = facebook; + return this; + } + + /** + * Get the gitHub property: The configuration settings of the GitHub provider. + * + * @return the gitHub value. + */ + public GitHub gitHub() { + return this.gitHub; + } + + /** + * Set the gitHub property: The configuration settings of the GitHub provider. + * + * @param gitHub the gitHub value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withGitHub(GitHub gitHub) { + this.gitHub = gitHub; + return this; + } + + /** + * Get the google property: The configuration settings of the Google provider. + * + * @return the google value. + */ + public Google google() { + return this.google; + } + + /** + * Set the google property: The configuration settings of the Google provider. + * + * @param google the google value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withGoogle(Google google) { + this.google = google; + return this; + } + + /** + * Get the legacyMicrosoftAccount property: The configuration settings of the legacy Microsoft Account provider. + * + * @return the legacyMicrosoftAccount value. + */ + public LegacyMicrosoftAccount legacyMicrosoftAccount() { + return this.legacyMicrosoftAccount; + } + + /** + * Set the legacyMicrosoftAccount property: The configuration settings of the legacy Microsoft Account provider. + * + * @param legacyMicrosoftAccount the legacyMicrosoftAccount value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withLegacyMicrosoftAccount(LegacyMicrosoftAccount legacyMicrosoftAccount) { + this.legacyMicrosoftAccount = legacyMicrosoftAccount; + return this; + } + + /** + * Get the twitter property: The configuration settings of the Twitter provider. + * + * @return the twitter value. + */ + public Twitter twitter() { + return this.twitter; + } + + /** + * Set the twitter property: The configuration settings of the Twitter provider. + * + * @param twitter the twitter value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withTwitter(Twitter twitter) { + this.twitter = twitter; + return this; + } + + /** + * Get the apple property: The configuration settings of the Apple provider. + * + * @return the apple value. + */ + public Apple apple() { + return this.apple; + } + + /** + * Set the apple property: The configuration settings of the Apple provider. + * + * @param apple the apple value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withApple(Apple apple) { + this.apple = apple; + return this; + } + + /** + * Get the azureStaticWebApp property: The configuration settings of the Azure Static Web Apps provider. + * + * @return the azureStaticWebApp value. + */ + public AzureStaticWebApp azureStaticWebApp() { + return this.azureStaticWebApp; + } + + /** + * Set the azureStaticWebApp property: The configuration settings of the Azure Static Web Apps provider. + * + * @param azureStaticWebApp the azureStaticWebApp value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withAzureStaticWebApp(AzureStaticWebApp azureStaticWebApp) { + this.azureStaticWebApp = azureStaticWebApp; + return this; + } + + /** + * Get the customOpenIdConnectProviders property: The map of the name of the alias of each custom Open ID Connect + * provider to the configuration settings of the custom Open ID Connect provider. + * + * @return the customOpenIdConnectProviders value. + */ + public Map customOpenIdConnectProviders() { + return this.customOpenIdConnectProviders; + } + + /** + * Set the customOpenIdConnectProviders property: The map of the name of the alias of each custom Open ID Connect + * provider to the configuration settings of the custom Open ID Connect provider. + * + * @param customOpenIdConnectProviders the customOpenIdConnectProviders value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withCustomOpenIdConnectProviders( + Map customOpenIdConnectProviders) { + this.customOpenIdConnectProviders = 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 (legacyMicrosoftAccount() != null) { + legacyMicrosoftAccount().validate(); + } + if (twitter() != null) { + twitter().validate(); + } + if (apple() != null) { + apple().validate(); + } + if (azureStaticWebApp() != null) { + azureStaticWebApp().validate(); + } + if (customOpenIdConnectProviders() != null) { + customOpenIdConnectProviders() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java new file mode 100644 index 0000000000000..0a07dda7c3c11 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Ingress configuration. */ +@Fluent +public final class Ingress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ingress.class); + + /* + * Hostname. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Bool indicating if app exposes an external http endpoint + */ + @JsonProperty(value = "external") + private Boolean external; + + /* + * Target Port in containers for traffic from ingress + */ + @JsonProperty(value = "targetPort") + private Integer targetPort; + + /* + * Ingress transport protocol + */ + @JsonProperty(value = "transport") + private IngressTransportMethod transport; + + /* + * Traffic weights for app's revisions + */ + @JsonProperty(value = "traffic") + private List traffic; + + /* + * custom domain bindings for Container Apps' hostnames. + */ + @JsonProperty(value = "customDomains") + private List customDomains; + + /* + * Bool indicating if HTTP connections to is allowed. If set to false HTTP + * connections are automatically redirected to HTTPS connections + */ + @JsonProperty(value = "allowInsecure") + private Boolean allowInsecure; + + /** + * Get the fqdn property: Hostname. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the external property: Bool indicating if app exposes an external http endpoint. + * + * @return the external value. + */ + public Boolean external() { + return this.external; + } + + /** + * Set the external property: Bool indicating if app exposes an external http endpoint. + * + * @param external the external value to set. + * @return the Ingress object itself. + */ + public Ingress withExternal(Boolean external) { + this.external = external; + return this; + } + + /** + * Get the targetPort property: Target Port in containers for traffic from ingress. + * + * @return the targetPort value. + */ + public Integer targetPort() { + return this.targetPort; + } + + /** + * Set the targetPort property: Target Port in containers for traffic from ingress. + * + * @param targetPort the targetPort value to set. + * @return the Ingress object itself. + */ + public Ingress withTargetPort(Integer targetPort) { + this.targetPort = targetPort; + return this; + } + + /** + * Get the transport property: Ingress transport protocol. + * + * @return the transport value. + */ + public IngressTransportMethod transport() { + return this.transport; + } + + /** + * Set the transport property: Ingress transport protocol. + * + * @param transport the transport value to set. + * @return the Ingress object itself. + */ + public Ingress withTransport(IngressTransportMethod transport) { + this.transport = transport; + return this; + } + + /** + * Get the traffic property: Traffic weights for app's revisions. + * + * @return the traffic value. + */ + public List traffic() { + return this.traffic; + } + + /** + * Set the traffic property: Traffic weights for app's revisions. + * + * @param traffic the traffic value to set. + * @return the Ingress object itself. + */ + public Ingress withTraffic(List traffic) { + this.traffic = traffic; + return this; + } + + /** + * Get the customDomains property: custom domain bindings for Container Apps' hostnames. + * + * @return the customDomains value. + */ + public List customDomains() { + return this.customDomains; + } + + /** + * Set the customDomains property: custom domain bindings for Container Apps' hostnames. + * + * @param customDomains the customDomains value to set. + * @return the Ingress object itself. + */ + public Ingress withCustomDomains(List customDomains) { + this.customDomains = customDomains; + return this; + } + + /** + * Get the allowInsecure property: Bool indicating if HTTP connections to is allowed. If set to false HTTP + * connections are automatically redirected to HTTPS connections. + * + * @return the allowInsecure value. + */ + public Boolean allowInsecure() { + return this.allowInsecure; + } + + /** + * Set the allowInsecure property: Bool indicating if HTTP connections to is allowed. If set to false HTTP + * connections are automatically redirected to HTTPS connections. + * + * @param allowInsecure the allowInsecure value to set. + * @return the Ingress object itself. + */ + public Ingress withAllowInsecure(Boolean allowInsecure) { + this.allowInsecure = allowInsecure; + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.java new file mode 100644 index 0000000000000..47af653dcf443 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IngressTransportMethod. */ +public final class IngressTransportMethod extends ExpandableStringEnum { + /** Static value auto for IngressTransportMethod. */ + public static final IngressTransportMethod AUTO = fromString("auto"); + + /** Static value http for IngressTransportMethod. */ + public static final IngressTransportMethod HTTP = fromString("http"); + + /** Static value http2 for IngressTransportMethod. */ + public static final IngressTransportMethod HTTP2 = fromString("http2"); + + /** + * Creates or finds a IngressTransportMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngressTransportMethod. + */ + @JsonCreator + public static IngressTransportMethod fromString(String name) { + return fromString(name, IngressTransportMethod.class); + } + + /** @return known IngressTransportMethod values. */ + public static Collection values() { + return values(IngressTransportMethod.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LegacyMicrosoftAccount.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LegacyMicrosoftAccount.java new file mode 100644 index 0000000000000..cdf67ace87e7b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LegacyMicrosoftAccount.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the legacy Microsoft Account provider. */ +@Fluent +public final class LegacyMicrosoftAccount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyMicrosoftAccount.class); + + /* + * Disabled if the legacy Microsoft Account provider should + * not be enabled despite the set registration; otherwise, + * Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the app registration for the legacy + * Microsoft Account provider. + */ + @JsonProperty(value = "registration") + private ClientRegistration registration; + + /* + * The configuration settings of the login flow. + */ + @JsonProperty(value = "login") + private LoginScopes login; + + /* + * The configuration settings of the legacy Microsoft Account provider + * token validation flow. + */ + @JsonProperty(value = "validation") + private AllowedAudiencesValidation validation; + + /** + * Get the state property: <code>Disabled</code> if the legacy Microsoft Account provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the legacy Microsoft Account provider should not be + * enabled despite the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the LegacyMicrosoftAccount object itself. + */ + public LegacyMicrosoftAccount withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the app registration for the legacy Microsoft + * Account provider. + * + * @return the registration value. + */ + public ClientRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the app registration for the legacy Microsoft + * Account provider. + * + * @param registration the registration value to set. + * @return the LegacyMicrosoftAccount object itself. + */ + public LegacyMicrosoftAccount withRegistration(ClientRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Get the login property: The configuration settings of the login flow. + * + * @return the login value. + */ + public LoginScopes login() { + return this.login; + } + + /** + * Set the login property: The configuration settings of the login flow. + * + * @param login the login value to set. + * @return the LegacyMicrosoftAccount object itself. + */ + public LegacyMicrosoftAccount withLogin(LoginScopes login) { + this.login = login; + return this; + } + + /** + * Get the validation property: The configuration settings of the legacy Microsoft Account provider token validation + * flow. + * + * @return the validation value. + */ + public AllowedAudiencesValidation validation() { + return this.validation; + } + + /** + * Set the validation property: The configuration settings of the legacy Microsoft Account provider token validation + * flow. + * + * @param validation the validation value to set. + * @return the LegacyMicrosoftAccount object itself. + */ + public LegacyMicrosoftAccount withValidation(AllowedAudiencesValidation validation) { + this.validation = 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java new file mode 100644 index 0000000000000..f4a37bbf289a8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log analytics configuration. */ +@Fluent +public final class LogAnalyticsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsConfiguration.class); + + /* + * Log analytics customer id + */ + @JsonProperty(value = "customerId") + private String customerId; + + /* + * Log analytics customer key + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /** + * Get the customerId property: Log analytics customer id. + * + * @return the customerId value. + */ + public String customerId() { + return this.customerId; + } + + /** + * Set the customerId property: Log analytics customer id. + * + * @param customerId the customerId value to set. + * @return the LogAnalyticsConfiguration object itself. + */ + public LogAnalyticsConfiguration withCustomerId(String customerId) { + this.customerId = customerId; + return this; + } + + /** + * Get the sharedKey property: Log analytics customer key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: Log analytics customer key. + * + * @param sharedKey the sharedKey value to set. + * @return the LogAnalyticsConfiguration object itself. + */ + public LogAnalyticsConfiguration withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Login.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Login.java new file mode 100644 index 0000000000000..b617bd5186baf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Login.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the login flow of users using ContainerApp Authentication/Authorization. */ +@Fluent +public final class Login { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Login.class); + + /* + * The route that specify the endpoint used for login and logout requests. + */ + @JsonProperty(value = "route") + private LoginRoute route; + + /* + * True if the fragments from the request are preserved after + * the login request is made; otherwise, False. + */ + @JsonProperty(value = "preserveUrlFragmentsForLogins") + private PreserveUrlFragmentsForLoginsMode preserveUrlFragmentsForLogins; + + /* + * External URLs that can be redirected to as part of logging in or logging + * out of the app. Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + */ + @JsonProperty(value = "allowedExternalRedirectUrls") + private List allowedExternalRedirectUrls; + + /** + * Get the route property: The route that specify the endpoint used for login and logout requests. + * + * @return the route value. + */ + public LoginRoute route() { + return this.route; + } + + /** + * Set the route property: The route that specify the endpoint used for login and logout requests. + * + * @param route the route value to set. + * @return the Login object itself. + */ + public Login withRoute(LoginRoute route) { + this.route = route; + return this; + } + + /** + * Get the preserveUrlFragmentsForLogins property: <code>True</code> if the fragments from the request + * are preserved after the login request is made; otherwise, <code>False</code>. + * + * @return the preserveUrlFragmentsForLogins value. + */ + public PreserveUrlFragmentsForLoginsMode preserveUrlFragmentsForLogins() { + return this.preserveUrlFragmentsForLogins; + } + + /** + * Set the preserveUrlFragmentsForLogins property: <code>True</code> if the fragments from the request + * are preserved after the login request is made; otherwise, <code>False</code>. + * + * @param preserveUrlFragmentsForLogins the preserveUrlFragmentsForLogins value to set. + * @return the Login object itself. + */ + public Login withPreserveUrlFragmentsForLogins(PreserveUrlFragmentsForLoginsMode preserveUrlFragmentsForLogins) { + this.preserveUrlFragmentsForLogins = preserveUrlFragmentsForLogins; + return this; + } + + /** + * Get the allowedExternalRedirectUrls property: External URLs that can be redirected to as part of logging in or + * logging out of the app. Note that the query string part of the URL is ignored. This is an advanced setting + * typically only needed by Windows Store application backends. Note that URLs within the current domain are always + * implicitly allowed. + * + * @return the allowedExternalRedirectUrls value. + */ + public List allowedExternalRedirectUrls() { + return this.allowedExternalRedirectUrls; + } + + /** + * Set the allowedExternalRedirectUrls property: External URLs that can be redirected to as part of logging in or + * logging out of the app. Note that the query string part of the URL is ignored. This is an advanced setting + * typically only needed by Windows Store application backends. Note that URLs within the current domain are always + * implicitly allowed. + * + * @param allowedExternalRedirectUrls the allowedExternalRedirectUrls value to set. + * @return the Login object itself. + */ + public Login withAllowedExternalRedirectUrls(List allowedExternalRedirectUrls) { + this.allowedExternalRedirectUrls = allowedExternalRedirectUrls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (route() != null) { + route().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoute.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoute.java new file mode 100644 index 0000000000000..36ffe87671074 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoute.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The route that specify the endpoint used for login and logout requests. */ +@Fluent +public final class LoginRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoginRoute.class); + + /* + * The endpoint at which a logout request should be made. + */ + @JsonProperty(value = "logoutEndpoint") + private String logoutEndpoint; + + /** + * Get the logoutEndpoint property: The endpoint at which a logout request should be made. + * + * @return the logoutEndpoint value. + */ + public String logoutEndpoint() { + return this.logoutEndpoint; + } + + /** + * Set the logoutEndpoint property: The endpoint at which a logout request should be made. + * + * @param logoutEndpoint the logoutEndpoint value to set. + * @return the LoginRoute object itself. + */ + public LoginRoute withLogoutEndpoint(String logoutEndpoint) { + this.logoutEndpoint = logoutEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginScopes.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginScopes.java new file mode 100644 index 0000000000000..33cb9a57a829b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginScopes.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the login flow, including the scopes that should be requested. */ +@Fluent +public final class LoginScopes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoginScopes.class); + + /* + * A list of the scopes that should be requested while authenticating. + */ + @JsonProperty(value = "scopes") + private List scopes; + + /** + * Get the scopes property: A list of the scopes that should be requested while authenticating. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: A list of the scopes that should be requested while authenticating. + * + * @param scopes the scopes value to set. + * @return the LoginScopes object itself. + */ + public LoginScopes withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java new file mode 100644 index 0000000000000..ece6deea1fe8e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedEnvironment. */ +public interface ManagedEnvironment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Environment. + * + * @return the provisioningState value. + */ + EnvironmentProvisioningState provisioningState(); + + /** + * Gets the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @return the daprAIInstrumentationKey value. + */ + String daprAIInstrumentationKey(); + + /** + * Gets the vnetConfiguration property: Vnet configuration for the environment. + * + * @return the vnetConfiguration value. + */ + VnetConfiguration vnetConfiguration(); + + /** + * Gets the deploymentErrors property: Any errors that occurred during deployment or deployment validation. + * + * @return the deploymentErrors value. + */ + String deploymentErrors(); + + /** + * Gets the defaultDomain property: Default Domain Name for the cluster. + * + * @return the defaultDomain value. + */ + String defaultDomain(); + + /** + * Gets the staticIp property: Static IP of the Environment. + * + * @return the staticIp value. + */ + String staticIp(); + + /** + * Gets the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to + * a destination. Currently only "log-analytics" is supported. + * + * @return the appLogsConfiguration value. + */ + AppLogsConfiguration appLogsConfiguration(); + + /** + * 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 inner com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner object. + * + * @return the inner object. + */ + ManagedEnvironmentInner innerModel(); + + /** The entirety of the ManagedEnvironment definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ManagedEnvironment definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedEnvironment definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedEnvironment 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 ManagedEnvironment 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 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.WithDaprAIInstrumentationKey, + DefinitionStages.WithVnetConfiguration, + DefinitionStages.WithAppLogsConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedEnvironment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedEnvironment create(Context context); + } + /** The stage of the ManagedEnvironment 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 ManagedEnvironment definition allowing to specify daprAIInstrumentationKey. */ + interface WithDaprAIInstrumentationKey { + /** + * Specifies the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export + * Service to Service communication telemetry. + * + * @param daprAIInstrumentationKey Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * @return the next definition stage. + */ + WithCreate withDaprAIInstrumentationKey(String daprAIInstrumentationKey); + } + /** The stage of the ManagedEnvironment definition allowing to specify vnetConfiguration. */ + interface WithVnetConfiguration { + /** + * Specifies the vnetConfiguration property: Vnet configuration for the environment. + * + * @param vnetConfiguration Vnet configuration for the environment. + * @return the next definition stage. + */ + WithCreate withVnetConfiguration(VnetConfiguration vnetConfiguration); + } + /** The stage of the ManagedEnvironment definition allowing to specify appLogsConfiguration. */ + interface WithAppLogsConfiguration { + /** + * Specifies the appLogsConfiguration property: Cluster configuration which enables the log daemon to export + * app logs to a destination. Currently only "log-analytics" is supported. + * + * @param appLogsConfiguration Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * @return the next definition stage. + */ + WithCreate withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration); + } + } + /** + * Begins update for the ManagedEnvironment resource. + * + * @return the stage of resource update. + */ + ManagedEnvironment.Update update(); + + /** The template for ManagedEnvironment update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedEnvironment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedEnvironment apply(Context context); + } + /** The ManagedEnvironment update stages. */ + interface UpdateStages { + /** The stage of the ManagedEnvironment update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. + * + * @param tags Application-specific metadata in the form of key-value pairs. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedEnvironment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedEnvironment refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.java new file mode 100644 index 0000000000000..261b7e322c01f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An environment for hosting container apps. */ +@Fluent +public final class ManagedEnvironmentPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentPatch.class); + + /* + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the tags property: Application-specific metadata in the form of key-value pairs. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set. + * @return the ManagedEnvironmentPatch object itself. + */ + public ManagedEnvironmentPatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java new file mode 100644 index 0000000000000..c5e3375dc09c8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; + +/** An immutable client-side representation of ManagedEnvironmentStorage. */ +public interface ManagedEnvironmentStorage { + /** + * 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: Storage properties. + * + * @return the properties value. + */ + ManagedEnvironmentStorageProperties 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.app.fluent.models.ManagedEnvironmentStorageInner object. + * + * @return the inner object. + */ + ManagedEnvironmentStorageInner innerModel(); + + /** The entirety of the ManagedEnvironmentStorage definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ManagedEnvironmentStorage definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedEnvironmentStorage definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ManagedEnvironmentStorage definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, envName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String envName); + } + /** + * The stage of the ManagedEnvironmentStorage 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. + */ + ManagedEnvironmentStorage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedEnvironmentStorage create(Context context); + } + /** The stage of the ManagedEnvironmentStorage definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Storage properties. + * + * @param properties Storage properties. + * @return the next definition stage. + */ + WithCreate withProperties(ManagedEnvironmentStorageProperties properties); + } + } + /** + * Begins update for the ManagedEnvironmentStorage resource. + * + * @return the stage of resource update. + */ + ManagedEnvironmentStorage.Update update(); + + /** The template for ManagedEnvironmentStorage update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedEnvironmentStorage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedEnvironmentStorage apply(Context context); + } + /** The ManagedEnvironmentStorage update stages. */ + interface UpdateStages { + /** The stage of the ManagedEnvironmentStorage update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Storage properties. + * + * @param properties Storage properties. + * @return the next definition stage. + */ + Update withProperties(ManagedEnvironmentStorageProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedEnvironmentStorage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedEnvironmentStorage refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java new file mode 100644 index 0000000000000..a37ec3af6dbd0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage properties. */ +@Fluent +public final class ManagedEnvironmentStorageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentStorageProperties.class); + + /* + * Azure file properties + */ + @JsonProperty(value = "azureFile") + private AzureFileProperties azureFile; + + /** + * Get the azureFile property: Azure file properties. + * + * @return the azureFile value. + */ + public AzureFileProperties azureFile() { + return this.azureFile; + } + + /** + * Set the azureFile property: Azure file properties. + * + * @param azureFile the azureFile value to set. + * @return the ManagedEnvironmentStorageProperties object itself. + */ + public ManagedEnvironmentStorageProperties withAzureFile(AzureFileProperties azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureFile() != null) { + azureFile().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.java new file mode 100644 index 0000000000000..0dab5d4666fb6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ManagedEnvironmentStoragesCollection. */ +public interface ManagedEnvironmentStoragesCollection { + /** + * Gets the value property: Collection of storage resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner object. + * + * @return the inner object. + */ + ManagedEnvironmentStoragesCollectionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java new file mode 100644 index 0000000000000..37b1b1ceca906 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ManagedEnvironments. */ +public interface ManagedEnvironments { + /** + * Get all Managed Environments for a subscription. + * + * @throws com.azure.resourcemanager.app.models.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}. + */ + PagedIterable list(); + + /** + * Get all Managed Environments for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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}. + */ + PagedIterable list(Context context); + + /** + * 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 com.azure.resourcemanager.app.models.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 PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * 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 com.azure.resourcemanager.app.models.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 PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * 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 name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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. + */ + ManagedEnvironment getByResourceGroup(String resourceGroupName, String name); + + /** + * 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 name 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.app.models.DefaultErrorResponseErrorException 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}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * 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 name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String name); + + /** + * 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 name 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.app.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 name, Context context); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException 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}. + */ + ManagedEnvironment getById(String id); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @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.app.models.DefaultErrorResponseErrorException 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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment if it does not have any container apps. + * + * @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.app.models.DefaultErrorResponseErrorException thrown if the request is rejected + * by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedEnvironment resource. + * + * @param name resource name. + * @return the first stage of the new ManagedEnvironment definition. + */ + ManagedEnvironment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java new file mode 100644 index 0000000000000..217fdecba4f8d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Environments. */ +@Fluent +public final class ManagedEnvironmentsCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the ManagedEnvironmentsCollection object itself. + */ + public ManagedEnvironmentsCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ManagedEnvironmentsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java new file mode 100644 index 0000000000000..9009c459a4e78 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedEnvironmentsStorages. */ +public interface ManagedEnvironmentsStorages { + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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. + */ + ManagedEnvironmentStoragesCollection list(String resourceGroupName, String envName); + + /** + * Get all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName 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.app.models.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}. + */ + Response listWithResponse( + String resourceGroupName, String envName, Context context); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 envName, String name); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name 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.app.models.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}. + */ + Response getWithResponse( + String resourceGroupName, String envName, String name, Context context); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 envName, String name); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name 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.app.models.DefaultErrorResponseErrorException thrown 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 envName, String name, Context context); + + /** + * Get storage for a managedEnvironment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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}. + */ + ManagedEnvironmentStorage getById(String id); + + /** + * Get storage for a managedEnvironment. + * + * @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.app.models.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}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete storage for a managedEnvironment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment. + * + * @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.app.models.DefaultErrorResponseErrorException thrown 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 ManagedEnvironmentStorage resource. + * + * @param name resource name. + * @return the first stage of the new ManagedEnvironmentStorage definition. + */ + ManagedEnvironmentStorage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentity.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentity.java new file mode 100644 index 0000000000000..ee54cad6ab536 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentity.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public class ManagedServiceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedServiceIdentity.class); + + /* + * The service principal ID of the system assigned identity. This property + * will only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and + * UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * 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. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * 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. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.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. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentityType.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..c54c9b542a5f5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentityType.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedServiceIdentityType. */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned,UserAssigned"); + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** @return known ManagedServiceIdentityType values. */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectClientCredential.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectClientCredential.java new file mode 100644 index 0000000000000..2f75380ec3f68 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectClientCredential.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The authentication client credentials of the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectClientCredential { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectClientCredential.class); + + /* + * The app setting that contains the client secret for the custom Open ID + * Connect provider. + */ + @JsonProperty(value = "clientSecretRefName") + private String clientSecretRefName; + + /** + * Get the clientSecretRefName property: The app setting that contains the client secret for the custom Open ID + * Connect provider. + * + * @return the clientSecretRefName value. + */ + public String clientSecretRefName() { + return this.clientSecretRefName; + } + + /** + * Set the clientSecretRefName property: The app setting that contains the client secret for the custom Open ID + * Connect provider. + * + * @param clientSecretRefName the clientSecretRefName value to set. + * @return the OpenIdConnectClientCredential object itself. + */ + public OpenIdConnectClientCredential withClientSecretRefName(String clientSecretRefName) { + this.clientSecretRefName = clientSecretRefName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectConfig.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectConfig.java new file mode 100644 index 0000000000000..e7780e3849a11 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectConfig.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the endpoints used for the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectConfig.class); + + /* + * The endpoint to be used to make an authorization request. + */ + @JsonProperty(value = "authorizationEndpoint") + private String authorizationEndpoint; + + /* + * The endpoint to be used to request a token. + */ + @JsonProperty(value = "tokenEndpoint") + private String tokenEndpoint; + + /* + * The endpoint that issues the token. + */ + @JsonProperty(value = "issuer") + private String issuer; + + /* + * The endpoint that provides the keys necessary to validate the token. + */ + @JsonProperty(value = "certificationUri") + private String certificationUri; + + /* + * The endpoint that contains all the configuration endpoints for the + * provider. + */ + @JsonProperty(value = "wellKnownOpenIdConfiguration") + private String wellKnownOpenIdConfiguration; + + /** + * Get the authorizationEndpoint property: The endpoint to be used to make an authorization request. + * + * @return the authorizationEndpoint value. + */ + public String authorizationEndpoint() { + return this.authorizationEndpoint; + } + + /** + * Set the authorizationEndpoint property: The endpoint to be used to make an authorization request. + * + * @param authorizationEndpoint the authorizationEndpoint value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withAuthorizationEndpoint(String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get the tokenEndpoint property: The endpoint to be used to request a token. + * + * @return the tokenEndpoint value. + */ + public String tokenEndpoint() { + return this.tokenEndpoint; + } + + /** + * Set the tokenEndpoint property: The endpoint to be used to request a token. + * + * @param tokenEndpoint the tokenEndpoint value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withTokenEndpoint(String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get the issuer property: The endpoint that issues the token. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Set the issuer property: The endpoint that issues the token. + * + * @param issuer the issuer value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withIssuer(String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get the certificationUri property: The endpoint that provides the keys necessary to validate the token. + * + * @return the certificationUri value. + */ + public String certificationUri() { + return this.certificationUri; + } + + /** + * Set the certificationUri property: The endpoint that provides the keys necessary to validate the token. + * + * @param certificationUri the certificationUri value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withCertificationUri(String certificationUri) { + this.certificationUri = certificationUri; + return this; + } + + /** + * Get the wellKnownOpenIdConfiguration property: The endpoint that contains all the configuration endpoints for the + * provider. + * + * @return the wellKnownOpenIdConfiguration value. + */ + public String wellKnownOpenIdConfiguration() { + return this.wellKnownOpenIdConfiguration; + } + + /** + * Set the wellKnownOpenIdConfiguration property: The endpoint that contains all the configuration endpoints for the + * provider. + * + * @param wellKnownOpenIdConfiguration the wellKnownOpenIdConfiguration value to set. + * @return the OpenIdConnectConfig object itself. + */ + public OpenIdConnectConfig withWellKnownOpenIdConfiguration(String wellKnownOpenIdConfiguration) { + this.wellKnownOpenIdConfiguration = wellKnownOpenIdConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectLogin.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectLogin.java new file mode 100644 index 0000000000000..fdd3a3353ac11 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectLogin.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the login flow of the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectLogin { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectLogin.class); + + /* + * The name of the claim that contains the users name. + */ + @JsonProperty(value = "nameClaimType") + private String nameClaimType; + + /* + * A list of the scopes that should be requested while authenticating. + */ + @JsonProperty(value = "scopes") + private List scopes; + + /** + * Get the nameClaimType property: The name of the claim that contains the users name. + * + * @return the nameClaimType value. + */ + public String nameClaimType() { + return this.nameClaimType; + } + + /** + * Set the nameClaimType property: The name of the claim that contains the users name. + * + * @param nameClaimType the nameClaimType value to set. + * @return the OpenIdConnectLogin object itself. + */ + public OpenIdConnectLogin withNameClaimType(String nameClaimType) { + this.nameClaimType = nameClaimType; + return this; + } + + /** + * Get the scopes property: A list of the scopes that should be requested while authenticating. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: A list of the scopes that should be requested while authenticating. + * + * @param scopes the scopes value to set. + * @return the OpenIdConnectLogin object itself. + */ + public OpenIdConnectLogin withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectRegistration.java new file mode 100644 index 0000000000000..2b5ce6b7d5312 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectRegistration.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the app registration for the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OpenIdConnectRegistration.class); + + /* + * The client id of the custom Open ID Connect provider. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The authentication credentials of the custom Open ID Connect provider. + */ + @JsonProperty(value = "clientCredential") + private OpenIdConnectClientCredential clientCredential; + + /* + * The configuration settings of the endpoints used for the custom Open ID + * Connect provider. + */ + @JsonProperty(value = "openIdConnectConfiguration") + private OpenIdConnectConfig openIdConnectConfiguration; + + /** + * Get the clientId property: The client id of the custom Open ID Connect provider. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client id of the custom Open ID Connect provider. + * + * @param clientId the clientId value to set. + * @return the OpenIdConnectRegistration object itself. + */ + public OpenIdConnectRegistration withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientCredential property: The authentication credentials of the custom Open ID Connect provider. + * + * @return the clientCredential value. + */ + public OpenIdConnectClientCredential clientCredential() { + return this.clientCredential; + } + + /** + * Set the clientCredential property: The authentication credentials of the custom Open ID Connect provider. + * + * @param clientCredential the clientCredential value to set. + * @return the OpenIdConnectRegistration object itself. + */ + public OpenIdConnectRegistration withClientCredential(OpenIdConnectClientCredential clientCredential) { + this.clientCredential = clientCredential; + return this; + } + + /** + * Get the openIdConnectConfiguration property: The configuration settings of the endpoints used for the custom Open + * ID Connect provider. + * + * @return the openIdConnectConfiguration value. + */ + public OpenIdConnectConfig openIdConnectConfiguration() { + return this.openIdConnectConfiguration; + } + + /** + * Set the openIdConnectConfiguration property: The configuration settings of the endpoints used for the custom Open + * ID Connect provider. + * + * @param openIdConnectConfiguration the openIdConnectConfiguration value to set. + * @return the OpenIdConnectRegistration object itself. + */ + public OpenIdConnectRegistration withOpenIdConnectConfiguration(OpenIdConnectConfig openIdConnectConfiguration) { + this.openIdConnectConfiguration = openIdConnectConfiguration; + 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java new file mode 100644 index 0000000000000..a2ef9d4853feb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; + +/** An immutable client-side representation of OperationDetail. */ +public interface OperationDetail { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.OperationDetailInner object. + * + * @return the inner object. + */ + OperationDetailInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java new file mode 100644 index 0000000000000..772d1141355c5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Resource provider of the operation + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource of the operation + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Resource provider of the operation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource of the operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.java new file mode 100644 index 0000000000000..80795cce2286d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available RP operations. + * + * @throws com.azure.resourcemanager.app.models.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 operations of the service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.models.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 operations of the service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/PreserveUrlFragmentsForLoginsMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/PreserveUrlFragmentsForLoginsMode.java new file mode 100644 index 0000000000000..fa29cabeb6fc8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/PreserveUrlFragmentsForLoginsMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PreserveUrlFragmentsForLoginsMode. */ +public final class PreserveUrlFragmentsForLoginsMode extends ExpandableStringEnum { + /** Static value True for PreserveUrlFragmentsForLoginsMode. */ + public static final PreserveUrlFragmentsForLoginsMode TRUE = fromString("True"); + + /** Static value False for PreserveUrlFragmentsForLoginsMode. */ + public static final PreserveUrlFragmentsForLoginsMode FALSE = fromString("False"); + + /** + * Creates or finds a PreserveUrlFragmentsForLoginsMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding PreserveUrlFragmentsForLoginsMode. + */ + @JsonCreator + public static PreserveUrlFragmentsForLoginsMode fromString(String name) { + return fromString(name, PreserveUrlFragmentsForLoginsMode.class); + } + + /** @return known PreserveUrlFragmentsForLoginsMode values. */ + public static Collection values() { + return values(PreserveUrlFragmentsForLoginsMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java new file mode 100644 index 0000000000000..c8bfb8807bb82 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App container Azure Queue based scaling rule. */ +@Fluent +public final class QueueScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueueScaleRule.class); + + /* + * Queue name. + */ + @JsonProperty(value = "queueName") + private String queueName; + + /* + * Queue length. + */ + @JsonProperty(value = "queueLength") + private Integer queueLength; + + /* + * Authentication secrets for the queue scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** + * Get the queueName property: Queue name. + * + * @return the queueName value. + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the queueName property: Queue name. + * + * @param queueName the queueName value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get the queueLength property: Queue length. + * + * @return the queueLength value. + */ + public Integer queueLength() { + return this.queueLength; + } + + /** + * Set the queueLength property: Queue length. + * + * @param queueLength the queueLength value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withQueueLength(Integer queueLength) { + this.queueLength = queueLength; + return this; + } + + /** + * Get the auth property: Authentication secrets for the queue scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the queue scale rule. + * + * @param auth the auth value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withAuth(List auth) { + this.auth = auth; + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java new file mode 100644 index 0000000000000..98c9456d6cc65 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Private Registry. */ +@Fluent +public final class RegistryCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryCredentials.class); + + /* + * Container Registry Server + */ + @JsonProperty(value = "server") + private String server; + + /* + * Container Registry Username + */ + @JsonProperty(value = "username") + private String username; + + /* + * The name of the Secret that contains the registry login password + */ + @JsonProperty(value = "passwordSecretRef") + private String passwordSecretRef; + + /** + * Get the server property: Container Registry Server. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: Container Registry Server. + * + * @param server the server value to set. + * @return the RegistryCredentials object itself. + */ + public RegistryCredentials withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username property: Container Registry Username. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Container Registry Username. + * + * @param username the username value to set. + * @return the RegistryCredentials object itself. + */ + public RegistryCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwordSecretRef property: The name of the Secret that contains the registry login password. + * + * @return the passwordSecretRef value. + */ + public String passwordSecretRef() { + return this.passwordSecretRef; + } + + /** + * Set the passwordSecretRef property: The name of the Secret that contains the registry login password. + * + * @param passwordSecretRef the passwordSecretRef value to set. + * @return the RegistryCredentials object itself. + */ + public RegistryCredentials withPasswordSecretRef(String passwordSecretRef) { + this.passwordSecretRef = passwordSecretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java new file mode 100644 index 0000000000000..ae98388a9bcf3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App registry information. */ +@Fluent +public final class RegistryInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryInfo.class); + + /* + * registry server Url. + */ + @JsonProperty(value = "registryUrl") + private String registryUrl; + + /* + * registry username. + */ + @JsonProperty(value = "registryUserName") + private String registryUsername; + + /* + * registry secret. + */ + @JsonProperty(value = "registryPassword") + private String registryPassword; + + /** + * Get the registryUrl property: registry server Url. + * + * @return the registryUrl value. + */ + public String registryUrl() { + return this.registryUrl; + } + + /** + * Set the registryUrl property: registry server Url. + * + * @param registryUrl the registryUrl value to set. + * @return the RegistryInfo object itself. + */ + public RegistryInfo withRegistryUrl(String registryUrl) { + this.registryUrl = registryUrl; + return this; + } + + /** + * Get the registryUsername property: registry username. + * + * @return the registryUsername value. + */ + public String registryUsername() { + return this.registryUsername; + } + + /** + * Set the registryUsername property: registry username. + * + * @param registryUsername the registryUsername value to set. + * @return the RegistryInfo object itself. + */ + public RegistryInfo withRegistryUsername(String registryUsername) { + this.registryUsername = registryUsername; + return this; + } + + /** + * Get the registryPassword property: registry secret. + * + * @return the registryPassword value. + */ + public String registryPassword() { + return this.registryPassword; + } + + /** + * Set the registryPassword property: registry secret. + * + * @param registryPassword the registryPassword value to set. + * @return the RegistryInfo object itself. + */ + public RegistryInfo withRegistryPassword(String registryPassword) { + this.registryPassword = registryPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.java new file mode 100644 index 0000000000000..854afb30875cd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Replica. */ +public interface Replica { + /** + * 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 createdTime property: Timestamp describing when the pod was created by controller. + * + * @return the createdTime value. + */ + OffsetDateTime createdTime(); + + /** + * Gets the containers property: The containers collection under a replica. + * + * @return the containers value. + */ + List containers(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ReplicaInner object. + * + * @return the inner object. + */ + ReplicaInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.java new file mode 100644 index 0000000000000..e0c08ed7a5a45 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ReplicaCollection. */ +public interface ReplicaCollection { + /** + * Gets the value property: Collection of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner object. + * + * @return the inner object. + */ + ReplicaCollectionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java new file mode 100644 index 0000000000000..3beb2955eaa71 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container object under Container App Revision Replica. */ +@Fluent +public final class ReplicaContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaContainer.class); + + /* + * The Name of the Container + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Id of the Container + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * The container ready status + */ + @JsonProperty(value = "ready") + private Boolean ready; + + /* + * The container start status + */ + @JsonProperty(value = "started") + private Boolean started; + + /* + * The container restart count + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /** + * Get the name property: The Name of the Container. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Name of the Container. + * + * @param name the name value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the containerId property: The Id of the Container. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: The Id of the Container. + * + * @param containerId the containerId value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the ready property: The container ready status. + * + * @return the ready value. + */ + public Boolean ready() { + return this.ready; + } + + /** + * Set the ready property: The container ready status. + * + * @param ready the ready value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withReady(Boolean ready) { + this.ready = ready; + return this; + } + + /** + * Get the started property: The container start status. + * + * @return the started value. + */ + public Boolean started() { + return this.started; + } + + /** + * Set the started property: The container start status. + * + * @param started the started value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withStarted(Boolean started) { + this.started = started; + return this; + } + + /** + * Get the restartCount property: The container restart count. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the restartCount property: The container restart count. + * + * @param restartCount the restartCount value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RequireHttpsMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RequireHttpsMode.java new file mode 100644 index 0000000000000..353e578a8fc1d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RequireHttpsMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RequireHttpsMode. */ +public final class RequireHttpsMode extends ExpandableStringEnum { + /** Static value True for RequireHttpsMode. */ + public static final RequireHttpsMode TRUE = fromString("True"); + + /** Static value False for RequireHttpsMode. */ + public static final RequireHttpsMode FALSE = fromString("False"); + + /** + * Creates or finds a RequireHttpsMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RequireHttpsMode. + */ + @JsonCreator + public static RequireHttpsMode fromString(String name) { + return fromString(name, RequireHttpsMode.class); + } + + /** @return known RequireHttpsMode values. */ + public static Collection values() { + return values(RequireHttpsMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java new file mode 100644 index 0000000000000..18832a6acc519 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Revision. */ +public interface Revision { + /** + * 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 createdTime property: Timestamp describing when the revision was created by controller. + * + * @return the createdTime value. + */ + OffsetDateTime createdTime(); + + /** + * Gets the fqdn property: Fully qualified domain name of the revision. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the template property: Container App Revision Template with all possible settings and the defaults if user + * did not provide them. The defaults are populated as they were at the creation time. + * + * @return the template value. + */ + Template template(); + + /** + * Gets the active property: Boolean describing if the Revision is Active. + * + * @return the active value. + */ + Boolean active(); + + /** + * Gets the replicas property: Number of pods currently running for this revision. + * + * @return the replicas value. + */ + Integer replicas(); + + /** + * Gets the trafficWeight property: Traffic weight assigned to this revision. + * + * @return the trafficWeight value. + */ + Integer trafficWeight(); + + /** + * Gets the provisioningError property: Optional Field - Platform Error Message. + * + * @return the provisioningError value. + */ + String provisioningError(); + + /** + * Gets the healthState property: Current health State of the revision. + * + * @return the healthState value. + */ + RevisionHealthState healthState(); + + /** + * Gets the provisioningState property: Current provisioning State of the revision. + * + * @return the provisioningState value. + */ + RevisionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.RevisionInner object. + * + * @return the inner object. + */ + RevisionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java new file mode 100644 index 0000000000000..0fed9e20e8e66 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Revisions collection ARM resource. */ +@Fluent +public final class RevisionCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RevisionCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the RevisionCollection object itself. + */ + public RevisionCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model RevisionCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.java new file mode 100644 index 0000000000000..ec82caa877b10 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RevisionHealthState. */ +public final class RevisionHealthState extends ExpandableStringEnum { + /** Static value Healthy for RevisionHealthState. */ + public static final RevisionHealthState HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for RevisionHealthState. */ + public static final RevisionHealthState UNHEALTHY = fromString("Unhealthy"); + + /** Static value None for RevisionHealthState. */ + public static final RevisionHealthState NONE = fromString("None"); + + /** + * Creates or finds a RevisionHealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RevisionHealthState. + */ + @JsonCreator + public static RevisionHealthState fromString(String name) { + return fromString(name, RevisionHealthState.class); + } + + /** @return known RevisionHealthState values. */ + public static Collection values() { + return values(RevisionHealthState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java new file mode 100644 index 0000000000000..6438685785062 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RevisionProvisioningState. */ +public final class RevisionProvisioningState extends ExpandableStringEnum { + /** Static value Provisioning for RevisionProvisioningState. */ + public static final RevisionProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for RevisionProvisioningState. */ + public static final RevisionProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Failed for RevisionProvisioningState. */ + public static final RevisionProvisioningState FAILED = fromString("Failed"); + + /** Static value Deprovisioning for RevisionProvisioningState. */ + public static final RevisionProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** Static value Deprovisioned for RevisionProvisioningState. */ + public static final RevisionProvisioningState DEPROVISIONED = fromString("Deprovisioned"); + + /** + * Creates or finds a RevisionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RevisionProvisioningState. + */ + @JsonCreator + public static RevisionProvisioningState fromString(String name) { + return fromString(name, RevisionProvisioningState.class); + } + + /** @return known RevisionProvisioningState values. */ + public static Collection values() { + return values(RevisionProvisioningState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java new file mode 100644 index 0000000000000..ad319ce240a95 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App scaling configurations. */ +@Fluent +public final class Scale { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Scale.class); + + /* + * Optional. Minimum number of container replicas. + */ + @JsonProperty(value = "minReplicas") + private Integer minReplicas; + + /* + * Optional. Maximum number of container replicas. Defaults to 10 if not + * set. + */ + @JsonProperty(value = "maxReplicas") + private Integer maxReplicas; + + /* + * Scaling rules. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the minReplicas property: Optional. Minimum number of container replicas. + * + * @return the minReplicas value. + */ + public Integer minReplicas() { + return this.minReplicas; + } + + /** + * Set the minReplicas property: Optional. Minimum number of container replicas. + * + * @param minReplicas the minReplicas value to set. + * @return the Scale object itself. + */ + public Scale withMinReplicas(Integer minReplicas) { + this.minReplicas = minReplicas; + return this; + } + + /** + * Get the maxReplicas property: Optional. Maximum number of container replicas. Defaults to 10 if not set. + * + * @return the maxReplicas value. + */ + public Integer maxReplicas() { + return this.maxReplicas; + } + + /** + * Set the maxReplicas property: Optional. Maximum number of container replicas. Defaults to 10 if not set. + * + * @param maxReplicas the maxReplicas value to set. + * @return the Scale object itself. + */ + public Scale withMaxReplicas(Integer maxReplicas) { + this.maxReplicas = maxReplicas; + return this; + } + + /** + * Get the rules property: Scaling rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Scaling rules. + * + * @param rules the rules value to set. + * @return the Scale object itself. + */ + public Scale withRules(List rules) { + this.rules = 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java new file mode 100644 index 0000000000000..3bd12dbadf8bf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container scaling rule. */ +@Fluent +public final class ScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleRule.class); + + /* + * Scale Rule Name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Azure Queue based scaling. + */ + @JsonProperty(value = "azureQueue") + private QueueScaleRule azureQueue; + + /* + * Custom scale rule. + */ + @JsonProperty(value = "custom") + private CustomScaleRule custom; + + /* + * HTTP requests based scaling. + */ + @JsonProperty(value = "http") + private HttpScaleRule http; + + /** + * Get the name property: Scale Rule Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Scale Rule Name. + * + * @param name the name value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the azureQueue property: Azure Queue based scaling. + * + * @return the azureQueue value. + */ + public QueueScaleRule azureQueue() { + return this.azureQueue; + } + + /** + * Set the azureQueue property: Azure Queue based scaling. + * + * @param azureQueue the azureQueue value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withAzureQueue(QueueScaleRule azureQueue) { + this.azureQueue = azureQueue; + return this; + } + + /** + * Get the custom property: Custom scale rule. + * + * @return the custom value. + */ + public CustomScaleRule custom() { + return this.custom; + } + + /** + * Set the custom property: Custom scale rule. + * + * @param custom the custom value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withCustom(CustomScaleRule custom) { + this.custom = custom; + return this; + } + + /** + * Get the http property: HTTP requests based scaling. + * + * @return the http value. + */ + public HttpScaleRule http() { + return this.http; + } + + /** + * Set the http property: HTTP requests based scaling. + * + * @param http the http value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withHttp(HttpScaleRule http) { + this.http = http; + 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(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java new file mode 100644 index 0000000000000..51d9a0d855f38 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Auth Secrets for Container App Scale Rule. */ +@Fluent +public final class ScaleRuleAuth { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleRuleAuth.class); + + /* + * Name of the Container App secret from which to pull the auth params. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /* + * Trigger Parameter that uses the secret + */ + @JsonProperty(value = "triggerParameter") + private String triggerParameter; + + /** + * Get the secretRef property: Name of the Container App secret from which to pull the auth params. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: Name of the Container App secret from which to pull the auth params. + * + * @param secretRef the secretRef value to set. + * @return the ScaleRuleAuth object itself. + */ + public ScaleRuleAuth withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Get the triggerParameter property: Trigger Parameter that uses the secret. + * + * @return the triggerParameter value. + */ + public String triggerParameter() { + return this.triggerParameter; + } + + /** + * Set the triggerParameter property: Trigger Parameter that uses the secret. + * + * @param triggerParameter the triggerParameter value to set. + * @return the ScaleRuleAuth object itself. + */ + public ScaleRuleAuth withTriggerParameter(String triggerParameter) { + this.triggerParameter = triggerParameter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java new file mode 100644 index 0000000000000..d5be33dd5650d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Secret definition. */ +@Fluent +public final class Secret { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Secret.class); + + /* + * Secret Name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Secret Value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Secret Name. + * + * @param name the name value to set. + * @return the Secret object itself. + */ + public Secret withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Secret Value. + * + * @param value the value value to set. + * @return the Secret object itself. + */ + public Secret withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SecretsCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SecretsCollection.java new file mode 100644 index 0000000000000..55345f5e4be78 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SecretsCollection.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.SecretsCollectionInner; +import java.util.List; + +/** An immutable client-side representation of SecretsCollection. */ +public interface SecretsCollection { + /** + * Gets the value property: Collection of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.SecretsCollectionInner object. + * + * @return the inner object. + */ + SecretsCollectionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java new file mode 100644 index 0000000000000..0013813792383 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; + +/** An immutable client-side representation of SourceControl. */ +public interface SourceControl { + /** + * 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 operationState property: Current provisioning State of the operation. + * + * @return the operationState value. + */ + SourceControlOperationState operationState(); + + /** + * Gets the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @return the repoUrl value. + */ + String repoUrl(); + + /** + * Gets the branch property: The branch which will trigger the auto deployment. + * + * @return the branch value. + */ + String branch(); + + /** + * Gets the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @return the githubActionConfiguration value. + */ + GithubActionConfiguration githubActionConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.SourceControlInner object. + * + * @return the inner object. + */ + SourceControlInner innerModel(); + + /** The entirety of the SourceControl definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SourceControl definition stages. */ + interface DefinitionStages { + /** The first stage of the SourceControl definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SourceControl definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, containerAppName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @return the next definition stage. + */ + WithCreate withExistingContainerApp(String resourceGroupName, String containerAppName); + } + /** + * The stage of the SourceControl 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.WithRepoUrl, + DefinitionStages.WithBranch, + DefinitionStages.WithGithubActionConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + SourceControl create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SourceControl create(Context context); + } + /** The stage of the SourceControl definition allowing to specify repoUrl. */ + interface WithRepoUrl { + /** + * Specifies the repoUrl property: The repo url which will be integrated to ContainerApp.. + * + * @param repoUrl The repo url which will be integrated to ContainerApp. + * @return the next definition stage. + */ + WithCreate withRepoUrl(String repoUrl); + } + /** The stage of the SourceControl definition allowing to specify branch. */ + interface WithBranch { + /** + * Specifies the branch property: The branch which will trigger the auto deployment. + * + * @param branch The branch which will trigger the auto deployment. + * @return the next definition stage. + */ + WithCreate withBranch(String branch); + } + /** The stage of the SourceControl definition allowing to specify githubActionConfiguration. */ + interface WithGithubActionConfiguration { + /** + * Specifies the githubActionConfiguration property: Container App Revision Template with all possible + * settings and the defaults if user did not provide them. The defaults are populated as they were at the + * creation time. + * + * @param githubActionConfiguration Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * @return the next definition stage. + */ + WithCreate withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration); + } + } + /** + * Begins update for the SourceControl resource. + * + * @return the stage of resource update. + */ + SourceControl.Update update(); + + /** The template for SourceControl update. */ + interface Update + extends UpdateStages.WithRepoUrl, UpdateStages.WithBranch, UpdateStages.WithGithubActionConfiguration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SourceControl apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SourceControl apply(Context context); + } + /** The SourceControl update stages. */ + interface UpdateStages { + /** The stage of the SourceControl update allowing to specify repoUrl. */ + interface WithRepoUrl { + /** + * Specifies the repoUrl property: The repo url which will be integrated to ContainerApp.. + * + * @param repoUrl The repo url which will be integrated to ContainerApp. + * @return the next definition stage. + */ + Update withRepoUrl(String repoUrl); + } + /** The stage of the SourceControl update allowing to specify branch. */ + interface WithBranch { + /** + * Specifies the branch property: The branch which will trigger the auto deployment. + * + * @param branch The branch which will trigger the auto deployment. + * @return the next definition stage. + */ + Update withBranch(String branch); + } + /** The stage of the SourceControl update allowing to specify githubActionConfiguration. */ + interface WithGithubActionConfiguration { + /** + * Specifies the githubActionConfiguration property: Container App Revision Template with all possible + * settings and the defaults if user did not provide them. The defaults are populated as they were at the + * creation time. + * + * @param githubActionConfiguration Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * @return the next definition stage. + */ + Update withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SourceControl refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SourceControl refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java new file mode 100644 index 0000000000000..b3571306596ac --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SourceControl collection ARM resource. */ +@Fluent +public final class SourceControlCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlCollection.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the SourceControlCollection object itself. + */ + public SourceControlCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SourceControlCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java new file mode 100644 index 0000000000000..e951a1ba9ca44 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceControlOperationState. */ +public final class SourceControlOperationState extends ExpandableStringEnum { + /** Static value InProgress for SourceControlOperationState. */ + public static final SourceControlOperationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for SourceControlOperationState. */ + public static final SourceControlOperationState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for SourceControlOperationState. */ + public static final SourceControlOperationState FAILED = fromString("Failed"); + + /** Static value Canceled for SourceControlOperationState. */ + public static final SourceControlOperationState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a SourceControlOperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceControlOperationState. + */ + @JsonCreator + public static SourceControlOperationState fromString(String name) { + return fromString(name, SourceControlOperationState.class); + } + + /** @return known SourceControlOperationState values. */ + public static Collection values() { + return values(SourceControlOperationState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/StorageType.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/StorageType.java new file mode 100644 index 0000000000000..754d19221ca47 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/StorageType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageType. */ +public final class StorageType extends ExpandableStringEnum { + /** Static value AzureFile for StorageType. */ + public static final StorageType AZURE_FILE = fromString("AzureFile"); + + /** Static value EmptyDir for StorageType. */ + public static final StorageType EMPTY_DIR = fromString("EmptyDir"); + + /** + * Creates or finds a StorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageType. + */ + @JsonCreator + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** @return known StorageType values. */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java new file mode 100644 index 0000000000000..8e37ce752a649 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Container App versioned application definition. Defines the desired state of an immutable revision. Any changes to + * this section Will result in a new revision being created. + */ +@Fluent +public final class Template { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Template.class); + + /* + * User friendly suffix that is appended to the revision name + */ + @JsonProperty(value = "revisionSuffix") + private String revisionSuffix; + + /* + * List of container definitions for the Container App. + */ + @JsonProperty(value = "containers") + private List containers; + + /* + * Scaling properties for the Container App. + */ + @JsonProperty(value = "scale") + private Scale scale; + + /* + * Dapr configuration for the Container App. + */ + @JsonProperty(value = "dapr") + private Dapr dapr; + + /* + * List of volume definitions for the Container App. + */ + @JsonProperty(value = "volumes") + private List volumes; + + /** + * Get the revisionSuffix property: User friendly suffix that is appended to the revision name. + * + * @return the revisionSuffix value. + */ + public String revisionSuffix() { + return this.revisionSuffix; + } + + /** + * Set the revisionSuffix property: User friendly suffix that is appended to the revision name. + * + * @param revisionSuffix the revisionSuffix value to set. + * @return the Template object itself. + */ + public Template withRevisionSuffix(String revisionSuffix) { + this.revisionSuffix = revisionSuffix; + return this; + } + + /** + * Get the containers property: List of container definitions for the Container App. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: List of container definitions for the Container App. + * + * @param containers the containers value to set. + * @return the Template object itself. + */ + public Template withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the scale property: Scaling properties for the Container App. + * + * @return the scale value. + */ + public Scale scale() { + return this.scale; + } + + /** + * Set the scale property: Scaling properties for the Container App. + * + * @param scale the scale value to set. + * @return the Template object itself. + */ + public Template withScale(Scale scale) { + this.scale = scale; + return this; + } + + /** + * Get the dapr property: Dapr configuration for the Container App. + * + * @return the dapr value. + */ + public Dapr dapr() { + return this.dapr; + } + + /** + * Set the dapr property: Dapr configuration for the Container App. + * + * @param dapr the dapr value to set. + * @return the Template object itself. + */ + public Template withDapr(Dapr dapr) { + this.dapr = dapr; + return this; + } + + /** + * Get the volumes property: List of volume definitions for the Container App. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: List of volume definitions for the Container App. + * + * @param volumes the volumes value to set. + * @return the Template object itself. + */ + public Template withVolumes(List volumes) { + this.volumes = volumes; + 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 (scale() != null) { + scale().validate(); + } + if (dapr() != null) { + dapr().validate(); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java new file mode 100644 index 0000000000000..0708f5fa4f48d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Traffic weight assigned to a revision. */ +@Fluent +public final class TrafficWeight { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficWeight.class); + + /* + * Name of a revision + */ + @JsonProperty(value = "revisionName") + private String revisionName; + + /* + * Traffic weight assigned to a revision + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Indicates that the traffic weight belongs to a latest stable revision + */ + @JsonProperty(value = "latestRevision") + private Boolean latestRevision; + + /** + * Get the revisionName property: Name of a revision. + * + * @return the revisionName value. + */ + public String revisionName() { + return this.revisionName; + } + + /** + * Set the revisionName property: Name of a revision. + * + * @param revisionName the revisionName value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withRevisionName(String revisionName) { + this.revisionName = revisionName; + return this; + } + + /** + * Get the weight property: Traffic weight assigned to a revision. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Traffic weight assigned to a revision. + * + * @param weight the weight value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the latestRevision property: Indicates that the traffic weight belongs to a latest stable revision. + * + * @return the latestRevision value. + */ + public Boolean latestRevision() { + return this.latestRevision; + } + + /** + * Set the latestRevision property: Indicates that the traffic weight belongs to a latest stable revision. + * + * @param latestRevision the latestRevision value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withLatestRevision(Boolean latestRevision) { + this.latestRevision = latestRevision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Twitter.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Twitter.java new file mode 100644 index 0000000000000..caeb50c30ca63 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Twitter.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Twitter provider. */ +@Fluent +public final class Twitter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Twitter.class); + + /* + * Disabled if the Twitter provider should not be enabled + * despite the set registration; otherwise, Enabled. + */ + @JsonProperty(value = "state") + private IdentityProviderState state; + + /* + * The configuration settings of the app registration for the Twitter + * provider. + */ + @JsonProperty(value = "registration") + private TwitterRegistration registration; + + /** + * Get the state property: <code>Disabled</code> if the Twitter provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @return the state value. + */ + public IdentityProviderState state() { + return this.state; + } + + /** + * Set the state property: <code>Disabled</code> if the Twitter provider should not be enabled despite + * the set registration; otherwise, <code>Enabled</code>. + * + * @param state the state value to set. + * @return the Twitter object itself. + */ + public Twitter withState(IdentityProviderState state) { + this.state = state; + return this; + } + + /** + * Get the registration property: The configuration settings of the app registration for the Twitter provider. + * + * @return the registration value. + */ + public TwitterRegistration registration() { + return this.registration; + } + + /** + * Set the registration property: The configuration settings of the app registration for the Twitter provider. + * + * @param registration the registration value to set. + * @return the Twitter object itself. + */ + public Twitter withRegistration(TwitterRegistration registration) { + this.registration = registration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registration() != null) { + registration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TwitterRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TwitterRegistration.java new file mode 100644 index 0000000000000..808d4c318ce6a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TwitterRegistration.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the app registration for the Twitter provider. */ +@Fluent +public final class TwitterRegistration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TwitterRegistration.class); + + /* + * The OAuth 1.0a consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + */ + @JsonProperty(value = "consumerKey") + private String consumerKey; + + /* + * The app secret ref name that contains the OAuth 1.0a consumer secret of + * the Twitter + * application used for sign-in. + */ + @JsonProperty(value = "consumerSecretRefName") + private String consumerSecretRefName; + + /** + * Get the consumerKey property: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This + * setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: + * https://dev.twitter.com/web/sign-in. + * + * @return the consumerKey value. + */ + public String consumerKey() { + return this.consumerKey; + } + + /** + * Set the consumerKey property: The OAuth 1.0a consumer key of the Twitter application used for sign-in. This + * setting is required for enabling Twitter Sign-In. Twitter Sign-In documentation: + * https://dev.twitter.com/web/sign-in. + * + * @param consumerKey the consumerKey value to set. + * @return the TwitterRegistration object itself. + */ + public TwitterRegistration withConsumerKey(String consumerKey) { + this.consumerKey = consumerKey; + return this; + } + + /** + * Get the consumerSecretRefName property: The app secret ref name that contains the OAuth 1.0a consumer secret of + * the Twitter application used for sign-in. + * + * @return the consumerSecretRefName value. + */ + public String consumerSecretRefName() { + return this.consumerSecretRefName; + } + + /** + * Set the consumerSecretRefName property: The app secret ref name that contains the OAuth 1.0a consumer secret of + * the Twitter application used for sign-in. + * + * @param consumerSecretRefName the consumerSecretRefName value to set. + * @return the TwitterRegistration object itself. + */ + public TwitterRegistration withConsumerSecretRefName(String consumerSecretRefName) { + this.consumerSecretRefName = consumerSecretRefName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Type.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Type.java new file mode 100644 index 0000000000000..f1a0f5591e9e0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Type.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Type. */ +public final class Type extends ExpandableStringEnum { + /** Static value liveness for Type. */ + public static final Type LIVENESS = fromString("liveness"); + + /** Static value readiness for Type. */ + public static final Type READINESS = fromString("readiness"); + + /** Static value startup for Type. */ + public static final Type STARTUP = fromString("startup"); + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** @return known Type values. */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UnauthenticatedClientAction.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UnauthenticatedClientAction.java new file mode 100644 index 0000000000000..b653d928e8f9d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UnauthenticatedClientAction.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UnauthenticatedClientAction. */ +public final class UnauthenticatedClientAction extends ExpandableStringEnum { + /** Static value RedirectToLoginPage for UnauthenticatedClientAction. */ + public static final UnauthenticatedClientAction REDIRECT_TO_LOGIN_PAGE = fromString("RedirectToLoginPage"); + + /** Static value AllowAnonymous for UnauthenticatedClientAction. */ + public static final UnauthenticatedClientAction ALLOW_ANONYMOUS = fromString("AllowAnonymous"); + + /** Static value Return401 for UnauthenticatedClientAction. */ + public static final UnauthenticatedClientAction RETURN401 = fromString("Return401"); + + /** Static value Return403 for UnauthenticatedClientAction. */ + public static final UnauthenticatedClientAction RETURN403 = fromString("Return403"); + + /** + * Creates or finds a UnauthenticatedClientAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding UnauthenticatedClientAction. + */ + @JsonCreator + public static UnauthenticatedClientAction fromString(String name) { + return fromString(name, UnauthenticatedClientAction.class); + } + + /** @return known UnauthenticatedClientAction values. */ + public static Collection values() { + return values(UnauthenticatedClientAction.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UserAssignedIdentity.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..99352b5b55f18 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentity.class); + + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java new file mode 100644 index 0000000000000..a6e005c3d7057 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties for apps environment to join a Virtual Network. */ +@Fluent +public final class VnetConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetConfiguration.class); + + /* + * Boolean indicating the environment only has an internal load balancer. + * These environments do not have a public static IP resource, must provide + * ControlPlaneSubnetResourceId and AppSubnetResourceId if enabling this + * property + */ + @JsonProperty(value = "internal") + private Boolean internal; + + /* + * Resource ID of a subnet for infrastructure components. This subnet must + * be in the same VNET as the subnet defined in runtimeSubnetId. Must not + * overlap with any other provided IP ranges. + */ + @JsonProperty(value = "infrastructureSubnetId") + private String infrastructureSubnetId; + + /* + * Resource ID of a subnet that Container App containers are injected into. + * This subnet must be in the same VNET as the subnet defined in + * infrastructureSubnetId. Must not overlap with any other provided IP + * ranges. + */ + @JsonProperty(value = "runtimeSubnetId") + private String runtimeSubnetId; + + /* + * CIDR notation IP range assigned to the Docker bridge, network. Must not + * overlap with any other provided IP ranges. + */ + @JsonProperty(value = "dockerBridgeCidr") + private String dockerBridgeCidr; + + /* + * IP range in CIDR notation that can be reserved for environment + * infrastructure IP addresses. Must not overlap with any other provided IP + * ranges. + */ + @JsonProperty(value = "platformReservedCidr") + private String platformReservedCidr; + + /* + * An IP address from the IP range defined by platformReservedCidr that + * will be reserved for the internal DNS server. + */ + @JsonProperty(value = "platformReservedDnsIP") + private String platformReservedDnsIp; + + /** + * Get the internal property: Boolean indicating the environment only has an internal load balancer. These + * environments do not have a public static IP resource, must provide ControlPlaneSubnetResourceId and + * AppSubnetResourceId if enabling this property. + * + * @return the internal value. + */ + public Boolean internal() { + return this.internal; + } + + /** + * Set the internal property: Boolean indicating the environment only has an internal load balancer. These + * environments do not have a public static IP resource, must provide ControlPlaneSubnetResourceId and + * AppSubnetResourceId if enabling this property. + * + * @param internal the internal value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withInternal(Boolean internal) { + this.internal = internal; + return this; + } + + /** + * Get the infrastructureSubnetId property: Resource ID of a subnet for infrastructure components. This subnet must + * be in the same VNET as the subnet defined in runtimeSubnetId. Must not overlap with any other provided IP ranges. + * + * @return the infrastructureSubnetId value. + */ + public String infrastructureSubnetId() { + return this.infrastructureSubnetId; + } + + /** + * Set the infrastructureSubnetId property: Resource ID of a subnet for infrastructure components. This subnet must + * be in the same VNET as the subnet defined in runtimeSubnetId. Must not overlap with any other provided IP ranges. + * + * @param infrastructureSubnetId the infrastructureSubnetId value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withInfrastructureSubnetId(String infrastructureSubnetId) { + this.infrastructureSubnetId = infrastructureSubnetId; + return this; + } + + /** + * Get the runtimeSubnetId property: Resource ID of a subnet that Container App containers are injected into. This + * subnet must be in the same VNET as the subnet defined in infrastructureSubnetId. Must not overlap with any other + * provided IP ranges. + * + * @return the runtimeSubnetId value. + */ + public String runtimeSubnetId() { + return this.runtimeSubnetId; + } + + /** + * Set the runtimeSubnetId property: Resource ID of a subnet that Container App containers are injected into. This + * subnet must be in the same VNET as the subnet defined in infrastructureSubnetId. Must not overlap with any other + * provided IP ranges. + * + * @param runtimeSubnetId the runtimeSubnetId value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withRuntimeSubnetId(String runtimeSubnetId) { + this.runtimeSubnetId = runtimeSubnetId; + return this; + } + + /** + * Get the dockerBridgeCidr property: CIDR notation IP range assigned to the Docker bridge, network. Must not + * overlap with any other provided IP ranges. + * + * @return the dockerBridgeCidr value. + */ + public String dockerBridgeCidr() { + return this.dockerBridgeCidr; + } + + /** + * Set the dockerBridgeCidr property: CIDR notation IP range assigned to the Docker bridge, network. Must not + * overlap with any other provided IP ranges. + * + * @param dockerBridgeCidr the dockerBridgeCidr value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withDockerBridgeCidr(String dockerBridgeCidr) { + this.dockerBridgeCidr = dockerBridgeCidr; + return this; + } + + /** + * Get the platformReservedCidr property: IP range in CIDR notation that can be reserved for environment + * infrastructure IP addresses. Must not overlap with any other provided IP ranges. + * + * @return the platformReservedCidr value. + */ + public String platformReservedCidr() { + return this.platformReservedCidr; + } + + /** + * Set the platformReservedCidr property: IP range in CIDR notation that can be reserved for environment + * infrastructure IP addresses. Must not overlap with any other provided IP ranges. + * + * @param platformReservedCidr the platformReservedCidr value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withPlatformReservedCidr(String platformReservedCidr) { + this.platformReservedCidr = platformReservedCidr; + return this; + } + + /** + * Get the platformReservedDnsIp property: An IP address from the IP range defined by platformReservedCidr that will + * be reserved for the internal DNS server. + * + * @return the platformReservedDnsIp value. + */ + public String platformReservedDnsIp() { + return this.platformReservedDnsIp; + } + + /** + * Set the platformReservedDnsIp property: An IP address from the IP range defined by platformReservedCidr that will + * be reserved for the internal DNS server. + * + * @param platformReservedDnsIp the platformReservedDnsIp value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withPlatformReservedDnsIp(String platformReservedDnsIp) { + this.platformReservedDnsIp = platformReservedDnsIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Volume.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Volume.java new file mode 100644 index 0000000000000..f5b23081df358 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Volume.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume definitions for the Container App. */ +@Fluent +public final class Volume { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Volume.class); + + /* + * Volume name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Storage type for the volume. If not provided, use EmptyDir. + */ + @JsonProperty(value = "storageType") + private StorageType storageType; + + /* + * Name of storage resource. No need to provide for EmptyDir. + */ + @JsonProperty(value = "storageName") + private String storageName; + + /** + * Get the name property: Volume name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Volume name. + * + * @param name the name value to set. + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the storageType property: Storage type for the volume. If not provided, use EmptyDir. + * + * @return the storageType value. + */ + public StorageType storageType() { + return this.storageType; + } + + /** + * Set the storageType property: Storage type for the volume. If not provided, use EmptyDir. + * + * @param storageType the storageType value to set. + * @return the Volume object itself. + */ + public Volume withStorageType(StorageType storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the storageName property: Name of storage resource. No need to provide for EmptyDir. + * + * @return the storageName value. + */ + public String storageName() { + return this.storageName; + } + + /** + * Set the storageName property: Name of storage resource. No need to provide for EmptyDir. + * + * @param storageName the storageName value to set. + * @return the Volume object itself. + */ + public Volume withStorageName(String storageName) { + this.storageName = storageName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VolumeMount.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VolumeMount.java new file mode 100644 index 0000000000000..d2114b1e5dce9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VolumeMount.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume mount for the Container App. */ +@Fluent +public final class VolumeMount { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VolumeMount.class); + + /* + * This must match the Name of a Volume. + */ + @JsonProperty(value = "volumeName") + private String volumeName; + + /* + * Path within the container at which the volume should be mounted.Must not + * contain ':'. + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** + * Get the volumeName property: This must match the Name of a Volume. + * + * @return the volumeName value. + */ + public String volumeName() { + return this.volumeName; + } + + /** + * Set the volumeName property: This must match the Name of a Volume. + * + * @param volumeName the volumeName value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withVolumeName(String volumeName) { + this.volumeName = volumeName; + return this; + } + + /** + * Get the mountPath property: Path within the container at which the volume should be mounted.Must not contain ':'. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Path within the container at which the volume should be mounted.Must not contain ':'. + * + * @param mountPath the mountPath value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java new file mode 100644 index 0000000000000..a76d1f5fed9ef --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.models; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java new file mode 100644 index 0000000000000..40481efaf8bf2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/module-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/module-info.java new file mode 100644 index 0000000000000..9a9e9c0342a92 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.app { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.app; + exports com.azure.resourcemanager.app.fluent; + exports com.azure.resourcemanager.app.fluent.models; + exports com.azure.resourcemanager.app.models; + + opens com.azure.resourcemanager.app.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.app.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..259d893916817 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesCreateOrUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.CertificateProperties; + +/** Samples for Certificates CreateOrUpdate. */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificate_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .certificates() + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingManagedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new CertificateProperties() + .withPassword("private key password") + .withValue("PFX-or-PEM-blob".getBytes())) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesDeleteSamples.java new file mode 100644 index 0000000000000..0903848151358 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificate_Delete.json + */ + /** + * Sample code: Delete Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .certificates() + .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesGetSamples.java new file mode 100644 index 0000000000000..092cd7592ef8c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificate_Get.json + */ + /** + * Sample code: Get Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .certificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesListSamples.java new file mode 100644 index 0000000000000..ce11cc78d489c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificates_ListByManagedEnvironment.json + */ + /** + * Sample code: List Certificates by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listCertificatesByManagedEnvironment( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.certificates().list("examplerg", "testcontainerenv", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesUpdateSamples.java new file mode 100644 index 0000000000000..2c958bdebcbcc --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/CertificatesUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.Certificate; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Certificates Update. */ +public final class CertificatesUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Certificates_Patch.json + */ + /** + * Sample code: Patch Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchCertificate(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + Certificate resource = + manager + .certificates() + .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5c63e13f750a5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AppRegistration; +import com.azure.resourcemanager.app.models.EasyAuthState; +import com.azure.resourcemanager.app.models.Facebook; +import com.azure.resourcemanager.app.models.GlobalValidation; +import com.azure.resourcemanager.app.models.IdentityProviders; +import com.azure.resourcemanager.app.models.UnauthenticatedClientAction; + +/** Samples for ContainerAppsAuthConfigs CreateOrUpdate. */ +public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppAuthConfig( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsAuthConfigs() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withState(EasyAuthState.ENABLED) + .withGlobalValidation( + new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientAction.ALLOW_ANONYMOUS)) + .withIdentityProviders( + new IdentityProviders() + .withFacebook( + new Facebook() + .withRegistration( + new AppRegistration().withAppId("123").withAppSecretRefName("facebook-secret")))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsDeleteSamples.java new file mode 100644 index 0000000000000..fa9eb4afd90b5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsAuthConfigs Delete. */ +public final class ContainerAppsAuthConfigsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_Delete.json + */ + /** + * Sample code: Delete Container App AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppAuthConfig(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsAuthConfigs() + .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsGetSamples.java new file mode 100644 index 0000000000000..e65402d3ed293 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsAuthConfigs Get. */ +public final class ContainerAppsAuthConfigsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_Get.json + */ + /** + * Sample code: Get Container App's AuthConfig. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSAuthConfig(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsAuthConfigs() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java new file mode 100644 index 0000000000000..805dcefcde270 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsAuthConfigs ListByContainerApp. */ +public final class ContainerAppsAuthConfigsListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/AuthConfigs_ListByContainer.json + */ + /** + * Sample code: List Auth Configs by Container Apps. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAuthConfigsByContainerApps(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsAuthConfigs().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..73465b216ae26 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AppProtocol; +import com.azure.resourcemanager.app.models.BindingType; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.Container; +import com.azure.resourcemanager.app.models.ContainerAppProbe; +import com.azure.resourcemanager.app.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.app.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.app.models.CustomDomain; +import com.azure.resourcemanager.app.models.CustomScaleRule; +import com.azure.resourcemanager.app.models.Dapr; +import com.azure.resourcemanager.app.models.Ingress; +import com.azure.resourcemanager.app.models.Scale; +import com.azure.resourcemanager.app.models.ScaleRule; +import com.azure.resourcemanager.app.models.Template; +import com.azure.resourcemanager.app.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps CreateOrUpdate. */ +public final class ContainerAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .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"))))) + .withTemplate( + new Template() + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("httpscalingrule") + .withCustom( + new CustomScaleRule() + .withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .create(); + } + + @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/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java new file mode 100644 index 0000000000000..d60e2aadd0b19 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerApps Delete. */ +public final class ContainerAppsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Delete.json + */ + /** + * Sample code: Delete Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().delete("rg", "testWorkerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..0fad12a66e13f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerApps GetByResourceGroup. */ +public final class ContainerAppsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Get.json + */ + /** + * Sample code: Get Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..7448c939a557f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerApps ListByResourceGroup. */ +public final class ContainerAppsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().listByResourceGroup("rg", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListCustomHostnameAnalysisSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListCustomHostnameAnalysisSamples.java new file mode 100644 index 0000000000000..dbbe713d73ddf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListCustomHostnameAnalysisSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerApps ListCustomHostnameAnalysis. */ +public final class ContainerAppsListCustomHostnameAnalysisSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json + */ + /** + * Sample code: Analyze Custom Hostname. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void analyzeCustomHostname(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerApps() + .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java new file mode 100644 index 0000000000000..fa7e28d2947cd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerApps List. */ +public final class ContainerAppsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListBySubscription.json + */ + /** + * Sample code: List Container Apps by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().list(Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSecretsSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSecretsSamples.java new file mode 100644 index 0000000000000..ca31a98f342c3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSecretsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerApps ListSecrets. */ +public final class ContainerAppsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListSecrets.json + */ + /** + * Sample code: List Container Apps Secrets. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsSecrets(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java new file mode 100644 index 0000000000000..78fd3b10b3cdb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisionReplicas GetReplica. */ +public final class ContainerAppsRevisionReplicasGetReplicaSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Replicas_Get.json + */ + /** + * Sample code: Get Container App's revision replica. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevisionReplica(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .getReplicaWithResponse( + "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java new file mode 100644 index 0000000000000..0376dfa50c56d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisionReplicas ListReplicas. */ +public final class ContainerAppsRevisionReplicasListReplicasSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Replicas_List.json + */ + /** + * Sample code: List Container App's replicas. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSReplicas(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java new file mode 100644 index 0000000000000..d02b4bd2234b4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions ActivateRevision. */ +public final class ContainerAppsRevisionsActivateRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Activate.json + */ + /** + * Sample code: Activate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void activateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java new file mode 100644 index 0000000000000..c4c05938450c7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions DeactivateRevision. */ +public final class ContainerAppsRevisionsDeactivateRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Deactivate.json + */ + /** + * Sample code: Deactivate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deactivateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java new file mode 100644 index 0000000000000..443e1f197fab1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions GetRevision. */ +public final class ContainerAppsRevisionsGetRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Get.json + */ + /** + * Sample code: Get Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java new file mode 100644 index 0000000000000..548c059cbc36b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions ListRevisions. */ +public final class ContainerAppsRevisionsListRevisionsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_List.json + */ + /** + * Sample code: List Container App's revisions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSRevisions(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java new file mode 100644 index 0000000000000..d32b68fcb3230 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsRevisions RestartRevision. */ +public final class ContainerAppsRevisionsRestartRevisionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Revisions_Restart.json + */ + /** + * Sample code: Restart Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void restartContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..43d8b0301cdf7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AzureCredentials; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.RegistryInfo; + +/** Samples for ContainerAppsSourceControls CreateOrUpdate. */ +public final class ContainerAppsSourceControlsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppSourceControl( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withRepoUrl("https://github.com/xwang971/ghatest") + .withBranch("master") + .withGithubActionConfiguration( + new GithubActionConfiguration() + .withRegistryInfo( + new RegistryInfo() + .withRegistryUrl("xwang971reg.azurecr.io") + .withRegistryUsername("xwang971reg") + .withRegistryPassword("")) + .withAzureCredentials( + new AzureCredentials() + .withClientId("") + .withClientSecret("") + .withTenantId(""))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java new file mode 100644 index 0000000000000..0a81b5ba112af --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsSourceControls Delete. */ +public final class ContainerAppsSourceControlsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json + */ + /** + * Sample code: Delete Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java new file mode 100644 index 0000000000000..3ca95369ac581 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsSourceControls Get. */ +public final class ContainerAppsSourceControlsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json + */ + /** + * Sample code: Get Container App's SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java new file mode 100644 index 0000000000000..2d385983ba043 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ContainerAppsSourceControls ListByContainerApp. */ +public final class ContainerAppsSourceControlsListByContainerAppSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_ListByContainer.json + */ + /** + * Sample code: List App's Source Controls. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAppSSourceControls(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java new file mode 100644 index 0000000000000..15c48aa081477 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.ContainerApp; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps Update. */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Patch.json + */ + /** + * Sample code: Patch Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ContainerApp resource = + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..934f2f9c28d9a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsCreateOrUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import java.util.Arrays; + +/** Samples for DaprComponents CreateOrUpdate. */ +public final class DaprComponentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_CreateOrUpdate.json + */ + /** + * Sample code: Create or update dapr component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateDaprComponent(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .daprComponents() + .define("reddog") + .withExistingManagedEnvironment("examplerg", "myenvironment") + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsDeleteSamples.java new file mode 100644 index 0000000000000..4e1cd0ef76f8f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for DaprComponents Delete. */ +public final class DaprComponentsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Delete.json + */ + /** + * Sample code: Delete dapr component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteDaprComponent(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.daprComponents().deleteWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsGetSamples.java new file mode 100644 index 0000000000000..fd7a670cb2ce8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for DaprComponents Get. */ +public final class DaprComponentsGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Get.json + */ + /** + * Sample code: Get Dapr Component. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDaprComponent(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsListSamples.java new file mode 100644 index 0000000000000..be842cb1afdf7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for DaprComponents List. */ +public final class DaprComponentsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_List.json + */ + /** + * Sample code: List Dapr Components. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listDaprComponents(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.daprComponents().list("examplerg", "myenvironment", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b031e13dbf59e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.LogAnalyticsConfiguration; + +/** Samples for ManagedEnvironments CreateOrUpdate. */ +public final class ManagedEnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json + */ + /** + * Sample code: Create environments. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createEnvironments(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withAppLogsConfiguration( + new AppLogsConfiguration() + .withLogAnalyticsConfiguration( + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("string"))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java new file mode 100644 index 0000000000000..2de0d97712a33 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments Delete. */ +public final class ManagedEnvironmentsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Delete.json + */ + /** + * Sample code: Delete environment by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteEnvironmentByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c6a6b8e574c35 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments GetByResourceGroup. */ +public final class ManagedEnvironmentsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Get.json + */ + /** + * Sample code: Get environments by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getEnvironmentsByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9325de837c354 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments ListByResourceGroup. */ +public final class ManagedEnvironmentsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json + */ + /** + * Sample code: List environments by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().listByResourceGroup("examplerg", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java new file mode 100644 index 0000000000000..5c4ecebe3da95 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironments List. */ +public final class ManagedEnvironmentsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_ListBySubscription.json + */ + /** + * Sample code: List environments by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().list(Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..391f0c2d4c4aa --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AccessMode; +import com.azure.resourcemanager.app.models.AzureFileProperties; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; + +/** Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ +public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + */ + /** + * Sample code: Create or update environments storage. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateEnvironmentsStorage( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingManagedEnvironment("examplerg", "managedEnv") + .withProperties( + new ManagedEnvironmentStorageProperties() + .withAzureFile( + new AzureFileProperties() + .withAccountName("account1") + .withAccountKey("key") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.java new file mode 100644 index 0000000000000..6ff838b725b3c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironmentsStorages Delete. */ +public final class ManagedEnvironmentsStoragesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_Delete.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.java new file mode 100644 index 0000000000000..00315d2f0ac1b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironmentsStorages Get. */ +public final class ManagedEnvironmentsStoragesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_Get.json + */ + /** + * Sample code: get a environments storage properties by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStoragePropertiesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.java new file mode 100644 index 0000000000000..c31205c4fa9a2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for ManagedEnvironmentsStorages List. */ +public final class ManagedEnvironmentsStoragesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_List.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.java new file mode 100644 index 0000000000000..fb16ce567dc45 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.ManagedEnvironment; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedEnvironments Update. */ +public final class ManagedEnvironmentsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Patch.json + */ + /** + * Sample code: Patch Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchManagedEnvironment(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ManagedEnvironment resource = + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "testcontainerenv", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + @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/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..41fb58188b27f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/Operations_List.json + */ + /** + * Sample code: List all operations. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAllOperations(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/app/ci.yml b/sdk/app/ci.yml new file mode 100644 index 0000000000000..28b46eddc610b --- /dev/null +++ b/sdk/app/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/app/ci.yml + - sdk/app/azure-resourcemanager-app/ + exclude: + - sdk/app/pom.xml + - sdk/app/azure-resourcemanager-app/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/app/ci.yml + - sdk/app/azure-resourcemanager-app/ + exclude: + - sdk/app/pom.xml + - sdk/app/azure-resourcemanager-app/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: app + Artifacts: + - name: azure-resourcemanager-app + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerapp diff --git a/sdk/app/pom.xml b/sdk/app/pom.xml new file mode 100644 index 0000000000000..b126fd1965d1d --- /dev/null +++ b/sdk/app/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-app-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-app + + + +