From 2680b5a9d8ac91f9b5963f6afc71fdb11f85ecd7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 6 Apr 2022 20:15:52 +0000 Subject: [PATCH] CodeGen from PR 18582 in Azure/azure-rest-api-specs Merge 96d0a6352585ec4a07a644b4cccd6760aa169681 into ca0335b44b4eca2c5b5673ee2c58a87e524b669f --- 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 | 1425 ++++++++++++ sdk/app/azure-resourcemanager-app/pom.xml | 55 + .../app/ContainerAppsApiManager.java | 369 ++++ .../app/fluent/CertificatesClient.java | 186 ++ .../app/fluent/ContainerAppsApiClient.java | 123 ++ .../ContainerAppsAuthConfigsClient.java | 147 ++ .../app/fluent/ContainerAppsClient.java | 340 +++ .../ContainerAppsRevisionReplicasClient.java | 81 + .../fluent/ContainerAppsRevisionsClient.java | 171 ++ .../ContainerAppsSourceControlsClient.java | 220 ++ .../app/fluent/DaprComponentsClient.java | 178 ++ .../app/fluent/ManagedEnvironmentsClient.java | 282 +++ .../ManagedEnvironmentsStoragesClient.java | 146 ++ .../app/fluent/NamespacesClient.java | 53 + .../app/fluent/OperationsClient.java | 38 + .../app/fluent/models/AuthConfigInner.java | 169 ++ .../fluent/models/AuthConfigProperties.java | 186 ++ .../app/fluent/models/CertificateInner.java | 83 + .../CheckNameAvailabilityResponseInner.java | 99 + .../app/fluent/models/ContainerAppInner.java | 205 ++ .../fluent/models/ContainerAppProperties.java | 183 ++ .../CustomHostnameAnalysisResultInner.java | 231 ++ ...ustomHostnameAnalysisResultProperties.java | 252 +++ .../app/fluent/models/DaprComponentInner.java | 220 ++ .../models/DaprComponentProperties.java | 211 ++ .../models/DaprSecretsCollectionInner.java | 59 + .../models/ManagedEnvironmentInner.java | 206 ++ .../models/ManagedEnvironmentProperties.java | 200 ++ .../ManagedEnvironmentStorageInner.java | 68 + ...gedEnvironmentStoragesCollectionInner.java | 58 + .../fluent/models/OperationDetailInner.java | 128 ++ .../fluent/models/ReplicaCollectionInner.java | 57 + .../app/fluent/models/ReplicaInner.java | 91 + .../app/fluent/models/ReplicaProperties.java | 67 + .../app/fluent/models/RevisionInner.java | 142 ++ .../app/fluent/models/RevisionProperties.java | 166 ++ .../fluent/models/SecretsCollectionInner.java | 58 + .../app/fluent/models/SourceControlInner.java | 138 ++ .../models/SourceControlProperties.java | 122 ++ .../app/fluent/models/package-info.java | 6 + .../app/fluent/package-info.java | 6 + .../app/implementation/AuthConfigImpl.java | 175 ++ .../app/implementation/CertificateImpl.java | 195 ++ .../CertificatesClientImpl.java | 1157 ++++++++++ .../app/implementation/CertificatesImpl.java | 197 ++ .../CheckNameAvailabilityResponseImpl.java | 42 + .../app/implementation/ContainerAppImpl.java | 233 ++ .../ContainerAppsApiClientBuilder.java | 146 ++ .../ContainerAppsApiClientImpl.java | 433 ++++ .../ContainerAppsAuthConfigsClientImpl.java | 914 ++++++++ .../ContainerAppsAuthConfigsImpl.java | 192 ++ .../ContainerAppsClientImpl.java | 1902 +++++++++++++++++ .../app/implementation/ContainerAppsImpl.java | 231 ++ ...ntainerAppsRevisionReplicasClientImpl.java | 440 ++++ .../ContainerAppsRevisionReplicasImpl.java | 90 + .../ContainerAppsRevisionsClientImpl.java | 1067 +++++++++ .../ContainerAppsRevisionsImpl.java | 101 + ...ContainerAppsSourceControlsClientImpl.java | 1132 ++++++++++ .../ContainerAppsSourceControlsImpl.java | 195 ++ .../CustomHostnameAnalysisResultImpl.java | 119 ++ .../app/implementation/DaprComponentImpl.java | 225 ++ .../DaprComponentsClientImpl.java | 1088 ++++++++++ .../implementation/DaprComponentsImpl.java | 227 ++ .../DaprSecretsCollectionImpl.java | 40 + .../ManagedEnvironmentImpl.java | 218 ++ .../ManagedEnvironmentStorageImpl.java | 143 ++ ...agedEnvironmentStoragesCollectionImpl.java | 48 + .../ManagedEnvironmentsClientImpl.java | 1539 +++++++++++++ .../ManagedEnvironmentsImpl.java | 187 ++ ...ManagedEnvironmentsStoragesClientImpl.java | 781 +++++++ .../ManagedEnvironmentsStoragesImpl.java | 211 ++ .../implementation/NamespacesClientImpl.java | 266 +++ .../app/implementation/NamespacesImpl.java | 73 + .../implementation/OperationDetailImpl.java | 45 + .../implementation/OperationsClientImpl.java | 270 +++ .../app/implementation/OperationsImpl.java | 45 + .../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 | 50 + .../app/models/AllowedPrincipals.java | 73 + .../app/models/AppLogsConfiguration.java | 75 + .../app/models/AppProtocol.java | 34 + .../app/models/AppRegistration.java | 72 + .../resourcemanager/app/models/Apple.java | 107 + .../app/models/AppleRegistration.java | 72 + .../app/models/AuthConfig.java | 292 +++ .../app/models/AuthConfigCollection.java | 73 + .../app/models/AuthPlatform.java | 82 + .../app/models/AvailableOperations.java | 80 + .../app/models/AzureActiveDirectory.java | 172 ++ .../app/models/AzureActiveDirectoryLogin.java | 80 + .../AzureActiveDirectoryRegistration.java | 225 ++ .../AzureActiveDirectoryValidation.java | 112 + .../app/models/AzureCredentials.java | 124 ++ .../app/models/AzureFileProperties.java | 124 ++ .../app/models/AzureStaticWebApps.java | 78 + .../AzureStaticWebAppsRegistration.java | 46 + .../app/models/BindingType.java | 34 + .../app/models/Certificate.java | 218 ++ .../app/models/CertificateCollection.java | 73 + .../app/models/CertificatePatch.java | 49 + .../app/models/CertificateProperties.java | 194 ++ .../models/CertificateProvisioningState.java | 43 + .../app/models/Certificates.java | 155 ++ .../models/CheckNameAvailabilityReason.java | 34 + .../models/CheckNameAvailabilityRequest.java | 72 + .../models/CheckNameAvailabilityResponse.java | 38 + .../app/models/ClientCredentialMethod.java | 44 + .../app/models/ClientRegistration.java | 72 + .../app/models/Configuration.java | 177 ++ .../resourcemanager/app/models/Container.java | 241 +++ .../app/models/ContainerApp.java | 363 ++++ .../app/models/ContainerAppCollection.java | 73 + .../app/models/ContainerAppProbe.java | 305 +++ .../app/models/ContainerAppProbeHttpGet.java | 160 ++ ...ntainerAppProbeHttpGetHttpHeadersItem.java | 87 + .../models/ContainerAppProbeTcpSocket.java | 75 + .../models/ContainerAppProvisioningState.java | 40 + .../app/models/ContainerAppSecret.java | 50 + .../app/models/ContainerApps.java | 247 +++ .../app/models/ContainerAppsAuthConfigs.java | 154 ++ .../models/ContainerAppsRevisionReplicas.java | 73 + .../app/models/ContainerAppsRevisions.java | 158 ++ .../models/ContainerAppsSourceControls.java | 154 ++ .../app/models/ContainerResources.java | 87 + .../app/models/CookieExpiration.java | 73 + .../models/CookieExpirationConvention.java | 47 + .../app/models/CustomDomain.java | 114 + .../models/CustomHostnameAnalysisResult.java | 127 ++ .../models/CustomOpenIdConnectProvider.java | 111 + .../app/models/CustomScaleRule.java | 106 + .../resourcemanager/app/models/Dapr.java | 127 ++ .../app/models/DaprComponent.java | 357 ++++ .../app/models/DaprComponents.java | 184 ++ .../app/models/DaprComponentsCollection.java | 73 + .../app/models/DaprMetadata.java | 99 + .../app/models/DaprSecretsCollection.java | 25 + .../models/DefaultAuthorizationPolicy.java | 80 + .../app/models/DefaultErrorResponseError.java | 36 + .../DefaultErrorResponseErrorException.java | 37 + .../app/models/DnsVerificationTestResult.java | 50 + .../models/EnvironmentProvisioningState.java | 61 + .../app/models/EnvironmentVar.java | 99 + .../resourcemanager/app/models/Facebook.java | 134 ++ .../app/models/ForwardProxy.java | 98 + .../app/models/ForwardProxyConvention.java | 50 + .../resourcemanager/app/models/GitHub.java | 108 + .../app/models/GithubActionConfiguration.java | 234 ++ .../app/models/GlobalValidation.java | 116 + .../resourcemanager/app/models/Google.java | 138 ++ .../app/models/HttpScaleRule.java | 79 + .../app/models/HttpSettings.java | 110 + .../app/models/HttpSettingsRoutes.java | 47 + .../app/models/IdentityProviders.java | 270 +++ .../resourcemanager/app/models/Ingress.java | 201 ++ .../app/models/IngressTransportMethod.java | 37 + .../app/models/JwtClaimChecks.java | 73 + .../app/models/LogAnalyticsConfiguration.java | 72 + .../resourcemanager/app/models/Login.java | 174 ++ .../app/models/LoginRoutes.java | 46 + .../app/models/LoginScopes.java | 47 + .../app/models/ManagedEnvironment.java | 330 +++ .../app/models/ManagedEnvironmentStorage.java | 157 ++ .../ManagedEnvironmentStorageProperties.java | 49 + .../ManagedEnvironmentStoragesCollection.java | 25 + .../app/models/ManagedEnvironments.java | 195 ++ .../models/ManagedEnvironmentsCollection.java | 74 + .../models/ManagedEnvironmentsStorages.java | 154 ++ .../app/models/ManagedServiceIdentity.java | 141 ++ .../models/ManagedServiceIdentityType.java | 41 + .../app/models/Namespaces.java | 47 + .../resourcemanager/app/models/Nonce.java | 75 + .../models/OpenIdConnectClientCredential.java | 75 + .../app/models/OpenIdConnectConfig.java | 153 ++ .../app/models/OpenIdConnectLogin.java | 73 + .../app/models/OpenIdConnectRegistration.java | 107 + .../app/models/OperationDetail.java | 45 + .../app/models/OperationDisplay.java | 124 ++ .../app/models/Operations.java | 33 + .../app/models/QueueScaleRule.java | 102 + .../app/models/RegistryCredentials.java | 98 + .../app/models/RegistryInfo.java | 98 + .../resourcemanager/app/models/Replica.java | 62 + .../app/models/ReplicaCollection.java | 25 + .../app/models/ReplicaContainer.java | 150 ++ .../resourcemanager/app/models/Revision.java | 111 + .../app/models/RevisionCollection.java | 73 + .../app/models/RevisionHealthState.java | 37 + .../app/models/RevisionProvisioningState.java | 43 + .../resourcemanager/app/models/Scale.java | 103 + .../resourcemanager/app/models/ScaleRule.java | 133 ++ .../app/models/ScaleRuleAuth.java | 72 + .../resourcemanager/app/models/Secret.java | 72 + .../app/models/SecretsCollection.java | 25 + .../app/models/SourceControl.java | 229 ++ .../app/models/SourceControlCollection.java | 73 + .../models/SourceControlOperationState.java | 40 + .../app/models/StorageType.java | 34 + .../resourcemanager/app/models/Template.java | 137 ++ .../app/models/TrafficWeight.java | 124 ++ .../resourcemanager/app/models/Twitter.java | 79 + .../app/models/TwitterRegistration.java | 82 + .../resourcemanager/app/models/Type.java | 37 + .../models/UnauthenticatedClientActionV2.java | 53 + .../app/models/UserAssignedIdentity.java | 51 + .../app/models/VnetConfiguration.java | 204 ++ .../resourcemanager/app/models/Volume.java | 98 + .../app/models/VolumeMount.java | 73 + .../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 | 123 ++ .../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 | 45 + ...tainerAppsSourceControlsDeleteSamples.java | 22 + ...ContainerAppsSourceControlsGetSamples.java | 24 + ...urceControlsListByContainerAppSamples.java | 22 + .../generated/ContainerAppsUpdateSamples.java | 126 ++ .../DaprComponentsCreateOrUpdateSamples.java | 41 + .../DaprComponentsDeleteSamples.java | 22 + .../generated/DaprComponentsGetSamples.java | 22 + .../generated/DaprComponentsListSamples.java | 22 + .../DaprComponentsListSecretsSamples.java | 22 + ...agedEnvironmentsCreateOrUpdateSamples.java | 33 + .../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 | 44 + ...amespacesCheckNameAvailabilitySamples.java | 51 + .../app/generated/OperationsListSamples.java | 22 + sdk/app/ci.yml | 39 + sdk/app/pom.xml | 53 + 269 files changed, 37578 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/NamespacesClient.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/CheckNameAvailabilityResponseInner.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/DaprSecretsCollectionInner.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/CheckNameAvailabilityResponseImpl.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/DaprSecretsCollectionImpl.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/NamespacesClientImpl.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/NamespacesImpl.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/AllowedPrincipals.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/AuthPlatform.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/AzureStaticWebApps.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppsRegistration.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/CertificateProvisioningState.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/CheckNameAvailabilityReason.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityRequest.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityResponse.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientCredentialMethod.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/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/CookieExpiration.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CookieExpirationConvention.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/DaprSecretsCollection.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultAuthorizationPolicy.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/DnsVerificationTestResult.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/ForwardProxy.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ForwardProxyConvention.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/HttpSettingsRoutes.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/JwtClaimChecks.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/LoginRoutes.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/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/Namespaces.java create mode 100644 sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Nonce.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/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/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/UnauthenticatedClientActionV2.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/DaprComponentsListSecretsSamples.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/NamespacesCheckNameAvailabilitySamples.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 9094ba44d3b97..a67caf67d744f 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -332,6 +332,7 @@ com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-azureadexternalidentities;1.0.0-beta.1;1.0.0-beta.1 +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 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index 76489cb77b347..a5d9a316f2707 100644 --- a/pom.xml +++ b/pom.xml @@ -845,6 +845,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..6b4ed1a29ad29 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-04-06) + +- Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-2022-03. 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..829b8461217be --- /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-03. 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..d3e5ac7dedaea --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/SAMPLE.md @@ -0,0 +1,1425 @@ +# 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) +- [ListSecrets](#daprcomponents_listsecrets) + +## 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) + +## Namespaces + +- [CheckNameAvailability](#namespaces_checknameavailability) + +## 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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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.TrafficWeight; +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/stable/2022-03-01/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) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains( + Arrays + .asList( + new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain() + .withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .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"))))))) + .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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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.fluent.models.ContainerAppInner; +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.TrafficWeight; +import com.azure.resourcemanager.app.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps Update. */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/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) { + manager + .containerApps() + .update( + "rg", + "testcontainerApp0", + new ContainerAppInner() + .withLocation("East US") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains( + Arrays + .asList( + new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain() + .withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .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"))))))), + Context.NONE); + } + + @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.AuthPlatform; +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.UnauthenticatedClientActionV2; + +/** Samples for ContainerAppsAuthConfigs CreateOrUpdate. */ +public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/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") + .withPlatform(new AuthPlatform().withEnabled(true)) + .withGlobalValidation( + new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS)) + .withIdentityProviders( + new IdentityProviders() + .withFacebook( + new Facebook() + .withRegistration( + new AppRegistration().withAppId("123").withAppSecretSettingName("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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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", null, 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/stable/2022-03-01/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/stable/2022-03-01/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("")) + .withContextPath("./") + .withImage("image/tag")) + .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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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); + } +} +``` + +### DaprComponents_ListSecrets + +```java +import com.azure.core.util.Context; + +/** Samples for DaprComponents ListSecrets. */ +public final class DaprComponentsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_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.daprComponents().listSecretsWithResponse("examplerg", "myenvironment", "reddog", 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/stable/2022-03-01/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"))) + .withZoneRedundant(true) + .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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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.fluent.models.ManagedEnvironmentInner; +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/stable/2022-03-01/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) { + manager + .managedEnvironments() + .update( + "examplerg", + "testcontainerenv", + new ManagedEnvironmentInner() + .withLocation("East US") + .withTags(mapOf("tag1", "value1", "tag2", "value2")), + Context.NONE); + } + + @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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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); + } +} +``` + +### Namespaces_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityRequest; + +/** Samples for Namespaces CheckNameAvailability. */ +public final class NamespacesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json + */ + /** + * Sample code: Certificates_CheckNameAvailability. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void certificatesCheckNameAvailability( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + "examplerg", + "testcontainerenv", + new CheckNameAvailabilityRequest() + .withName("testcertificatename") + .withType("Microsoft.App/managedEnvironments/certificates"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json + */ + /** + * Sample code: ContainerApps_CheckNameAvailability. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsCheckNameAvailability( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + "examplerg", + "testcontainerenv", + new CheckNameAvailabilityRequest().withName("testcappname").withType("Microsoft.App/containerApps"), + 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/stable/2022-03-01/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..23644dc1d7c99 --- /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-03. + 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.27.0 + + + com.azure + azure-core-management + 1.5.4 + + + 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..4d84731fd287d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java @@ -0,0 +1,369 @@ +// 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.NamespacesImpl; +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.Namespaces; +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 ContainerAppsAuthConfigs containerAppsAuthConfigs; + + private ContainerApps containerApps; + + private ContainerAppsRevisions containerAppsRevisions; + + private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; + + private DaprComponents daprComponents; + + private Operations operations; + + private ManagedEnvironments managedEnvironments; + + private Certificates certificates; + + private Namespaces namespaces; + + private ManagedEnvironmentsStorages managedEnvironmentsStorages; + + private ContainerAppsSourceControls containerAppsSourceControls; + + 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 static 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, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' 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 ContainerAppsAuthConfigs. */ + public ContainerAppsAuthConfigs containerAppsAuthConfigs() { + if (this.containerAppsAuthConfigs == null) { + this.containerAppsAuthConfigs = + new ContainerAppsAuthConfigsImpl(clientObject.getContainerAppsAuthConfigs(), this); + } + return containerAppsAuthConfigs; + } + + /** @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 DaprComponents. */ + public DaprComponents daprComponents() { + if (this.daprComponents == null) { + this.daprComponents = new DaprComponentsImpl(clientObject.getDaprComponents(), this); + } + return daprComponents; + } + + /** @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 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 Namespaces. */ + public Namespaces namespaces() { + if (this.namespaces == null) { + this.namespaces = new NamespacesImpl(clientObject.getNamespaces(), this); + } + return namespaces; + } + + /** @return Resource collection API of ManagedEnvironmentsStorages. */ + public ManagedEnvironmentsStorages managedEnvironmentsStorages() { + if (this.managedEnvironmentsStorages == null) { + this.managedEnvironmentsStorages = + new ManagedEnvironmentsStoragesImpl(clientObject.getManagedEnvironmentsStorages(), this); + } + return managedEnvironmentsStorages; + } + + /** @return Resource collection API of ContainerAppsSourceControls. */ + public ContainerAppsSourceControls containerAppsSourceControls() { + if (this.containerAppsSourceControls == null) { + this.containerAppsSourceControls = + new ContainerAppsSourceControlsImpl(clientObject.getContainerAppsSourceControls(), this); + } + return containerAppsSourceControls; + } + + /** + * @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..f38d310c284be --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 ContainerAppsAuthConfigsClient object to access its operations. + * + * @return the ContainerAppsAuthConfigsClient object. + */ + ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs(); + + /** + * 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 DaprComponentsClient object to access its operations. + * + * @return the DaprComponentsClient object. + */ + DaprComponentsClient getDaprComponents(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * 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 NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + NamespacesClient getNamespaces(); + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); + + /** + * Gets the ContainerAppsSourceControlsClient object to access its operations. + * + * @return the ContainerAppsSourceControlsClient object. + */ + ContainerAppsSourceControlsClient getContainerAppsSourceControls(); +} 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..f01f73068149e --- /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 Service 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 Service 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..dab4ad6aafa70 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java @@ -0,0 +1,340 @@ +// 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; + +/** 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 using JSON Merge Patch. + * + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope); + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context); + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope); + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String name, ContainerAppInner 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..0ceb013756c04 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.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, String filter, 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..e327b1ffce588 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/DaprComponentsClient.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; + +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; +import com.azure.resourcemanager.app.fluent.models.DaprSecretsCollectionInner; + +/** 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); + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DaprSecretsCollectionInner listSecrets(String resourceGroupName, String environmentName, String name); + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + 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..e2fdf06034c59 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java @@ -0,0 +1,282 @@ +// 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; + +/** 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 using JSON Merge Patch. + * + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope); + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context); + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope); + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update(String resourceGroupName, String name, ManagedEnvironmentInner 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/NamespacesClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/NamespacesClient.java new file mode 100644 index 0000000000000..0d0af361fc6f9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/NamespacesClient.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.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.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityRequest; + +/** An instance of this class provides access to all the operations defined in NamespacesClient. */ +public interface NamespacesClient { + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @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 check availability result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResponseInner checkNameAvailability( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest); + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.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 check availability result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest, + 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..a75efb99632a0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.app.models.AuthPlatform; +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.JsonProperty; + +/** Configuration settings for the Azure ContainerApp Service Authentication / Authorization feature. */ +@Fluent +public final class AuthConfigInner extends ProxyResource { + /* + * AuthConfig resource specific properties + */ + @JsonProperty(value = "properties") + private AuthConfigProperties innerProperties; + + /** + * Get the innerProperties property: AuthConfig resource specific properties. + * + * @return the innerProperties value. + */ + private AuthConfigProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * + * @return the platform value. + */ + public AuthPlatform platform() { + return this.innerProperties() == null ? null : this.innerProperties().platform(); + } + + /** + * Set the platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * + * @param platform the platform value to set. + * @return the AuthConfigInner object itself. + */ + public AuthConfigInner withPlatform(AuthPlatform platform) { + if (this.innerProperties() == null) { + this.innerProperties = new AuthConfigProperties(); + } + this.innerProperties().withPlatform(platform); + return this; + } + + /** + * Get the globalValidation property: The configuration settings that determines the validation flow of users using + * Service 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 + * Service 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 Service 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 Service 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 Service + * 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 Service + * 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 Service 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 Service 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..df1fef5a441d7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/AuthConfigProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.app.models.AuthPlatform; +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.JsonProperty; + +/** AuthConfig resource specific properties. */ +@Fluent +public final class AuthConfigProperties { + /* + * The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + */ + @JsonProperty(value = "platform") + private AuthPlatform platform; + + /* + * The configuration settings that determines the validation flow of users + * using Service Authentication/Authorization. + */ + @JsonProperty(value = "globalValidation") + private GlobalValidation globalValidation; + + /* + * The configuration settings of each of the identity providers used to + * configure ContainerApp Service Authentication/Authorization. + */ + @JsonProperty(value = "identityProviders") + private IdentityProviders identityProviders; + + /* + * The configuration settings of the login flow of users using ContainerApp + * Service Authentication/Authorization. + */ + @JsonProperty(value = "login") + private Login login; + + /* + * The configuration settings of the HTTP requests for authentication and + * authorization requests made against ContainerApp Service + * Authentication/Authorization. + */ + @JsonProperty(value = "httpSettings") + private HttpSettings httpSettings; + + /** + * Get the platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * + * @return the platform value. + */ + public AuthPlatform platform() { + return this.platform; + } + + /** + * Set the platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * + * @param platform the platform value to set. + * @return the AuthConfigProperties object itself. + */ + public AuthConfigProperties withPlatform(AuthPlatform platform) { + this.platform = platform; + return this; + } + + /** + * Get the globalValidation property: The configuration settings that determines the validation flow of users using + * Service 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 + * Service 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 Service 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 Service 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 Service + * 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 Service + * 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 Service 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 Service 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 (platform() != null) { + platform().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..a4c5ce521a375 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CertificateInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.models.CertificateProperties; +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 { + /* + * 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/CheckNameAvailabilityResponseInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CheckNameAvailabilityResponseInner.java new file mode 100644 index 0000000000000..1d5e6e7e1a57e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CheckNameAvailabilityResponseInner.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The check availability result. */ +@Fluent +public final class CheckNameAvailabilityResponseInner { + /* + * Indicates if the resource name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason why the given name is not available. + */ + @JsonProperty(value = "reason") + private CheckNameAvailabilityReason reason; + + /* + * Detailed reason why the given name is available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: Indicates if the resource name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicates if the resource name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason why the given name is not available. + * + * @return the reason value. + */ + public CheckNameAvailabilityReason reason() { + return this.reason; + } + + /** + * Set the reason property: The reason why the given name is not available. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Detailed reason why the given name is available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Detailed reason why the given name is available. + * + * @param message the message value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} 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..c3eff1004d0ac --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App. */ +@Fluent +public final class ContainerAppInner extends Resource { + /* + * 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..e0584b84fbec1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +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.JsonProperty; +import java.util.List; + +/** ContainerApp resource specific properties. */ +@Fluent +public final class ContainerAppProperties { + /* + * 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..208820d538984 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultInner.java @@ -0,0 +1,231 @@ +// 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.resourcemanager.app.models.DefaultErrorResponseError; +import com.azure.resourcemanager.app.models.DnsVerificationTestResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Custom domain analysis. */ +@Fluent +public final class CustomHostnameAnalysisResultInner extends ProxyResource { + /* + * CustomHostnameAnalysisResult resource specific properties + */ + @JsonProperty(value = "properties") + private CustomHostnameAnalysisResultProperties 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: CustomHostnameAnalysisResult resource specific properties. + * + * @return the innerProperties value. + */ + private CustomHostnameAnalysisResultProperties 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 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..a026383a60024 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/CustomHostnameAnalysisResultProperties.java @@ -0,0 +1,252 @@ +// 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.resourcemanager.app.models.DefaultErrorResponseError; +import com.azure.resourcemanager.app.models.DnsVerificationTestResult; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** CustomHostnameAnalysisResult resource specific properties. */ +@Fluent +public final class CustomHostnameAnalysisResultProperties { + /* + * 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..866e5a39a709c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr Component. */ +@Fluent +public final class DaprComponentInner extends ProxyResource { + /* + * 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..c7325969f04fb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprComponentProperties.java @@ -0,0 +1,211 @@ +// 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.resourcemanager.app.models.DaprMetadata; +import com.azure.resourcemanager.app.models.Secret; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr Component resource specific properties. */ +@Fluent +public final class DaprComponentProperties { + /* + * 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/DaprSecretsCollectionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprSecretsCollectionInner.java new file mode 100644 index 0000000000000..b35efd963a5a4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/DaprSecretsCollectionInner.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.Secret; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr component Secrets Collection ARM resource. */ +@Fluent +public final class DaprSecretsCollectionInner { + /* + * Collection of secrets used by a Dapr component + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Collection of secrets used by a Dapr component. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of secrets used by a Dapr component. + * + * @param value the value value to set. + * @return the DaprSecretsCollectionInner object itself. + */ + public DaprSecretsCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model DaprSecretsCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DaprSecretsCollectionInner.class); +} 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..e6a02bf7ccb2e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +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.JsonProperty; +import java.util.Map; + +/** An environment for hosting container apps. */ +@Fluent +public final class ManagedEnvironmentInner extends Resource { + /* + * 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; + } + + /** + * Get the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.innerProperties() == null ? null : this.innerProperties().zoneRedundant(); + } + + /** + * Set the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withZoneRedundant(Boolean zoneRedundant) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withZoneRedundant(zoneRedundant); + 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..11d69a760df96 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java @@ -0,0 +1,200 @@ +// 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.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed environment resource specific properties. */ +@Fluent +public final class ManagedEnvironmentProperties { + /* + * 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; + + /* + * Whether or not this Managed Environment is zone-redundant. + */ + @JsonProperty(value = "zoneRedundant") + private Boolean zoneRedundant; + + /** + * 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; + } + + /** + * Get the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: Whether or not this Managed Environment is zone-redundant. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withZoneRedundant(Boolean zoneRedundant) { + this.zoneRedundant = zoneRedundant; + 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..127cc7d2c0f77 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java @@ -0,0 +1,68 @@ +// 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.resourcemanager.app.models.ManagedEnvironmentStorageProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage resource for managedEnvironment. */ +@Fluent +public final class ManagedEnvironmentStorageInner extends ProxyResource { + /* + * 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..9d3fbbd544179 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.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.JsonProperty; +import java.util.List; + +/** Collection of Storage for Environments. */ +@Fluent +public final class ManagedEnvironmentStoragesCollectionInner { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentStoragesCollectionInner.class); +} 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..5b1aef4499441 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.app.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation detail payload. */ +@Fluent +public final class OperationDetailInner { + /* + * 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..0be0c0b9a6590 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Revision Replicas collection ARM resource. */ +@Fluent +public final class ReplicaCollectionInner { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ReplicaCollectionInner.class); +} 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..e79ed7ee659b7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.models.ReplicaContainer; +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 { + /* + * 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..f180a4ee72f71 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Replica resource specific properties. */ +@Fluent +public final class ReplicaProperties { + /* + * 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..2869c02d511f4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.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.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Container App Revision. */ +@Fluent +public final class RevisionInner extends ProxyResource { + /* + * 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..3599e9ccafc3e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Immutable; +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.JsonProperty; +import java.time.OffsetDateTime; + +/** Revision resource specific properties. */ +@Immutable +public final class RevisionProperties { + /* + * 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..d5649afd482e0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SecretsCollectionInner.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.azure.resourcemanager.app.models.ContainerAppSecret; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Secrets Collection ARM resource. */ +@Fluent +public final class SecretsCollectionInner { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretsCollectionInner.class); +} 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..6101e318798f3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControlOperationState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App SourceControl. */ +@Fluent +public final class SourceControlInner extends ProxyResource { + /* + * 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..2dd14416ae9e6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControlOperationState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SourceControl resource specific properties. */ +@Fluent +public final class SourceControlProperties { + /* + * 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..5a6693b5e5b36 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/AuthConfigImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +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.AuthPlatform; +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 AuthPlatform platform() { + return this.innerModel().platform(); + } + + 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 withPlatform(AuthPlatform platform) { + this.innerModel().withPlatform(platform); + 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..5f87c5214aa6f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesClientImpl.java @@ -0,0 +1,1157 @@ +// 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.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 { + /** 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..db581f40924d0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CertificatesImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +public final class CertificatesImpl implements Certificates { + private static 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/CheckNameAvailabilityResponseImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CheckNameAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..aa56c5880bd70 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CheckNameAvailabilityResponseImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityReason; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityResponse; + +public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse { + private CheckNameAvailabilityResponseInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + CheckNameAvailabilityResponseImpl( + CheckNameAvailabilityResponseInner innerObject, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public CheckNameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResponseInner 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/ContainerAppImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java new file mode 100644 index 0000000000000..e8016d789287b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.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; + + 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() { + return this; + } + + public ContainerApp apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ContainerApp apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + 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) { + this.innerModel().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; + } +} 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..7d550b326b45d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java @@ -0,0 +1,433 @@ +// 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.NamespacesClient; +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 { + /** 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 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 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 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 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 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 NamespacesClient object to access its operations. */ + private final NamespacesClient namespaces; + + /** + * Gets the NamespacesClient object to access its operations. + * + * @return the NamespacesClient object. + */ + public NamespacesClient getNamespaces() { + return this.namespaces; + } + + /** The ManagedEnvironmentsStoragesClient object to access its operations. */ + private final ManagedEnvironmentsStoragesClient managedEnvironmentsStorages; + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + public ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages() { + return this.managedEnvironmentsStorages; + } + + /** The 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; + } + + /** + * 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-03-01"; + this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); + this.containerApps = new ContainerAppsClientImpl(this); + this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); + this.containerAppsRevisionReplicas = new ContainerAppsRevisionReplicasClientImpl(this); + this.daprComponents = new DaprComponentsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); + this.certificates = new CertificatesClientImpl(this); + this.namespaces = new NamespacesClientImpl(this); + this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); + this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(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)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppsApiClientImpl.class); +} 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..947835f615f3b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsClientImpl.java @@ -0,0 +1,914 @@ +// 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.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 { + /** 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 Service 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 Service 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 Service 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 Service 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 Service 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..bd78a325dfda7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsAuthConfigsImpl.java @@ -0,0 +1,192 @@ +// 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; + +public final class ContainerAppsAuthConfigsImpl implements ContainerAppsAuthConfigs { + private static 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..8a0e7143a027b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java @@ -0,0 +1,1902 @@ +// 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.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.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 { + /** 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({202}) + @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") ContainerAppInner 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 using JSON Merge Patch. + * + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + 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 + .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 using JSON Merge Patch. + * + * @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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + 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 + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, containerAppEnvelope); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, name, containerAppEnvelope, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return beginUpdateAsync(resourceGroupName, name, containerAppEnvelope).getSyncPoller(); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, name, containerAppEnvelope, context).getSyncPoller(); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return beginUpdateAsync(resourceGroupName, name, containerAppEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, name, containerAppEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + updateAsync(resourceGroupName, name, containerAppEnvelope).block(); + } + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + updateAsync(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..0a616eacc3e76 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java @@ -0,0 +1,231 @@ +// 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; + +public final class ContainerAppsImpl implements ContainerApps { + private static 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 void update(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + this.serviceClient().update(resourceGroupName, name, containerAppEnvelope); + } + + public void update(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + this.serviceClient().update(resourceGroupName, name, containerAppEnvelope, 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..70a3c0194e93f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java @@ -0,0 +1,440 @@ +// 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.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 { + /** 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..60cd8ba103281 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.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.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; + +public final class ContainerAppsRevisionReplicasImpl implements ContainerAppsRevisionReplicas { + private static 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..625a1cb12b19f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java @@ -0,0 +1,1067 @@ +// 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.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 { + /** 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, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{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. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Revisions for a given Container App along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync( + String resourceGroupName, String containerAppName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRevisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + this.client.getApiVersion(), + filter, + accept, + context)) + .>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 filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Revisions for a given Container App along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync( + String resourceGroupName, String containerAppName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRevisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + this.client.getApiVersion(), + filter, + 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. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Revisions for a given Container App as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync( + String resourceGroupName, String containerAppName, String filter) { + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName, filter), + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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) { + final String filter = null; + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName, filter), + 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 filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Revisions for a given Container App as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync( + String resourceGroupName, String containerAppName, String filter, Context context) { + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName, filter, 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) { + final String filter = null; + return new PagedIterable<>(listRevisionsAsync(resourceGroupName, containerAppName, filter)); + } + + /** + * 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 filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Revisions for a given Container App as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions( + String resourceGroupName, String containerAppName, String filter, Context context) { + return new PagedIterable<>(listRevisionsAsync(resourceGroupName, containerAppName, filter, 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..f6efcfe2897c5 --- /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; + +public final class ContainerAppsRevisionsImpl implements ContainerAppsRevisions { + private static 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, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listRevisions(resourceGroupName, containerAppName, filter, 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..80812054d0832 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java @@ -0,0 +1,1132 @@ +// 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.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 { + /** 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..4a2ad6b3286a7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.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.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; + +public final class ContainerAppsSourceControlsImpl implements ContainerAppsSourceControls { + private static 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..e5f4fd172e237 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/CustomHostnameAnalysisResultImpl.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.implementation; + +import com.azure.core.management.SystemData; +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 SystemData systemData() { + return this.innerModel().systemData(); + } + + 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..4bc8aeb5e6ff4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentImpl.java @@ -0,0 +1,225 @@ +// 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.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.DaprSecretsCollection; +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 DaprSecretsCollection listSecrets() { + return serviceManager.daprComponents().listSecrets(resourceGroupName, environmentName, name); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager + .daprComponents() + .listSecretsWithResponse(resourceGroupName, environmentName, name, context); + } + + 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..ea2278146ec72 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsClientImpl.java @@ -0,0 +1,1088 @@ +// 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.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.app.fluent.DaprComponentsClient; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import com.azure.resourcemanager.app.fluent.models.DaprSecretsCollectionInner; +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 { + /** 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"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{environmentName}/daprComponents/{name}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listSecrets( + @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(); + } + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + 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 + .listSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + 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 + .listSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync( + String resourceGroupName, String environmentName, String name) { + return listSecretsWithResponseAsync(resourceGroupName, environmentName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DaprSecretsCollectionInner listSecrets(String resourceGroupName, String environmentName, String name) { + return listSecretsAsync(resourceGroupName, environmentName, name).block(); + } + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String environmentName, String name, Context context) { + return listSecretsWithResponseAsync(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..a3bf9ba1594fe --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprComponentsImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.fluent.models.DaprSecretsCollectionInner; +import com.azure.resourcemanager.app.models.DaprComponent; +import com.azure.resourcemanager.app.models.DaprComponents; +import com.azure.resourcemanager.app.models.DaprSecretsCollection; + +public final class DaprComponentsImpl implements DaprComponents { + private static 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 DaprSecretsCollection listSecrets(String resourceGroupName, String environmentName, String name) { + DaprSecretsCollectionInner inner = this.serviceClient().listSecrets(resourceGroupName, environmentName, name); + if (inner != null) { + return new DaprSecretsCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String environmentName, String name, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, environmentName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DaprSecretsCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + 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/DaprSecretsCollectionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprSecretsCollectionImpl.java new file mode 100644 index 0000000000000..b7c498c065f63 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/DaprSecretsCollectionImpl.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.DaprSecretsCollectionInner; +import com.azure.resourcemanager.app.models.DaprSecretsCollection; +import com.azure.resourcemanager.app.models.Secret; +import java.util.Collections; +import java.util.List; + +public final class DaprSecretsCollectionImpl implements DaprSecretsCollection { + private DaprSecretsCollectionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + DaprSecretsCollectionImpl( + DaprSecretsCollectionInner 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 DaprSecretsCollectionInner 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/ManagedEnvironmentImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java new file mode 100644 index 0000000000000..708ead11c8bbc --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.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.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.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 Boolean zoneRedundant() { + return this.innerModel().zoneRedundant(); + } + + 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; + + 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() { + return this; + } + + public ManagedEnvironment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ManagedEnvironment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + 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) { + this.innerModel().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; + } + + public ManagedEnvironmentImpl withZoneRedundant(Boolean zoneRedundant) { + this.innerModel().withZoneRedundant(zoneRedundant); + return this; + } +} 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..b6c601239fb0a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java @@ -0,0 +1,1539 @@ +// 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.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.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 { + /** 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({202}) + @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") ManagedEnvironmentInner 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 using JSON Merge Patch. + * + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + 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 + .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 using JSON Merge Patch. + * + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + 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 + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, name, environmentEnvelope); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUpdateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, name, environmentEnvelope, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + return beginUpdateAsync(resourceGroupName, name, environmentEnvelope).getSyncPoller(); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, name, environmentEnvelope, context).getSyncPoller(); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + return beginUpdateAsync(resourceGroupName, name, environmentEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, name, environmentEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update(String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + updateAsync(resourceGroupName, name, environmentEnvelope).block(); + } + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + updateAsync(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..a0ef352918bfe --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.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.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; + +public final class ManagedEnvironmentsImpl implements ManagedEnvironments { + private static 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 void update(String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + this.serviceClient().update(resourceGroupName, name, environmentEnvelope); + } + + public void update( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + this.serviceClient().update(resourceGroupName, name, environmentEnvelope, 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..a46d193a470d0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java @@ -0,0 +1,781 @@ +// 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.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 { + /** 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..6c301d712ee6a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java @@ -0,0 +1,211 @@ +// 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; + +public final class ManagedEnvironmentsStoragesImpl implements ManagedEnvironmentsStorages { + private static 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/NamespacesClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/NamespacesClientImpl.java new file mode 100644 index 0000000000000..626ba534d9f53 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/NamespacesClientImpl.java @@ -0,0 +1,266 @@ +// 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.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.app.fluent.NamespacesClient; +import com.azure.resourcemanager.app.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityRequest; +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 NamespacesClient. */ +public final class NamespacesClientImpl implements NamespacesClient { + /** The proxy service used to perform REST calls. */ + private final NamespacesService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of NamespacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NamespacesClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(NamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientNamespaces to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface NamespacesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{managedEnvironmentName}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("managedEnvironmentName") String managedEnvironmentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") CheckNameAvailabilityRequest checkNameAvailabilityRequest, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (managedEnvironmentName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedEnvironmentName is required and cannot be null.")); + } + if (checkNameAvailabilityRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkNameAvailabilityRequest is required and cannot be null.")); + } else { + checkNameAvailabilityRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + this.client.getApiVersion(), + checkNameAvailabilityRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest, + 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 (checkNameAvailabilityRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter checkNameAvailabilityRequest is required and cannot be null.")); + } else { + checkNameAvailabilityRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + managedEnvironmentName, + this.client.getApiVersion(), + checkNameAvailabilityRequest, + accept, + context); + } + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, managedEnvironmentName, checkNameAvailabilityRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResponseInner checkNameAvailability( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest) { + return checkNameAvailabilityAsync(resourceGroupName, managedEnvironmentName, checkNameAvailabilityRequest) + .block(); + } + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest, + Context context) { + return checkNameAvailabilityWithResponseAsync( + resourceGroupName, managedEnvironmentName, checkNameAvailabilityRequest, context) + .block(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/NamespacesImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/NamespacesImpl.java new file mode 100644 index 0000000000000..1176d84eadc0a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/NamespacesImpl.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.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.NamespacesClient; +import com.azure.resourcemanager.app.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityResponse; +import com.azure.resourcemanager.app.models.Namespaces; + +public final class NamespacesImpl implements Namespaces { + private static final ClientLogger LOGGER = new ClientLogger(NamespacesImpl.class); + + private final NamespacesClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public NamespacesImpl( + NamespacesClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResponse checkNameAvailability( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest) { + CheckNameAvailabilityResponseInner inner = + this + .serviceClient() + .checkNameAvailability(resourceGroupName, managedEnvironmentName, checkNameAvailabilityRequest); + if (inner != null) { + return new CheckNameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest, + Context context) { + Response inner = + this + .serviceClient() + .checkNameAvailabilityWithResponse( + resourceGroupName, managedEnvironmentName, checkNameAvailabilityRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private NamespacesClient 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/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..0e98f3cfcab26 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.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 { + /** 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..1f1f9d691a63d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.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.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; + +public final class OperationsImpl implements Operations { + private static 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..831a4ff313757 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedAudiencesValidation.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Allowed Audiences validation flow. */ +@Fluent +public final class AllowedAudiencesValidation { + /* + * 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/AllowedPrincipals.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedPrincipals.java new file mode 100644 index 0000000000000..5cd0fa1aab236 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AllowedPrincipals.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Azure Active Directory allowed principals. */ +@Fluent +public final class AllowedPrincipals { + /* + * The list of the allowed groups. + */ + @JsonProperty(value = "groups") + private List groups; + + /* + * The list of the allowed identities. + */ + @JsonProperty(value = "identities") + private List identities; + + /** + * Get the groups property: The list of the allowed groups. + * + * @return the groups value. + */ + public List groups() { + return this.groups; + } + + /** + * Set the groups property: The list of the allowed groups. + * + * @param groups the groups value to set. + * @return the AllowedPrincipals object itself. + */ + public AllowedPrincipals withGroups(List groups) { + this.groups = groups; + return this; + } + + /** + * Get the identities property: The list of the allowed identities. + * + * @return the identities value. + */ + public List identities() { + return this.identities; + } + + /** + * Set the identities property: The list of the allowed identities. + * + * @param identities the identities value to set. + * @return the AllowedPrincipals object itself. + */ + public AllowedPrincipals withIdentities(List identities) { + this.identities = identities; + 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..0c4dd1cae700c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.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.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration of application logs. */ +@Fluent +public final class AppLogsConfiguration { + /* + * 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..c5b85a59663c4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppRegistration.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.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * The App ID of the app used for login. + */ + @JsonProperty(value = "appId") + private String appId; + + /* + * The app setting name that contains the app secret. + */ + @JsonProperty(value = "appSecretSettingName") + private String appSecretSettingName; + + /** + * 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 appSecretSettingName property: The app setting name that contains the app secret. + * + * @return the appSecretSettingName value. + */ + public String appSecretSettingName() { + return this.appSecretSettingName; + } + + /** + * Set the appSecretSettingName property: The app setting name that contains the app secret. + * + * @param appSecretSettingName the appSecretSettingName value to set. + * @return the AppRegistration object itself. + */ + public AppRegistration withAppSecretSettingName(String appSecretSettingName) { + this.appSecretSettingName = appSecretSettingName; + 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..49be2bf42a32c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Apple.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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Apple provider. */ +@Fluent +public final class Apple { + /* + * false if the Apple provider should not be enabled despite + * the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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 enabled property: <code>false</code> if the Apple provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the Apple provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the Apple object itself. + */ + public Apple withEnabled(Boolean enabled) { + this.enabled = enabled; + 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..11f2fa40f7777 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppleRegistration.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the registration for the Apple provider. */ +@Fluent +public final class AppleRegistration { + /* + * The Client ID of the app used for login. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The app setting name that contains the client secret. + */ + @JsonProperty(value = "clientSecretSettingName") + private String clientSecretSettingName; + + /** + * 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 clientSecretSettingName property: The app setting name that contains the client secret. + * + * @return the clientSecretSettingName value. + */ + public String clientSecretSettingName() { + return this.clientSecretSettingName; + } + + /** + * Set the clientSecretSettingName property: The app setting name that contains the client secret. + * + * @param clientSecretSettingName the clientSecretSettingName value to set. + * @return the AppleRegistration object itself. + */ + public AppleRegistration withClientSecretSettingName(String clientSecretSettingName) { + this.clientSecretSettingName = clientSecretSettingName; + 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..2259965bb6689 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfig.java @@ -0,0 +1,292 @@ +// 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.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 platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * + * @return the platform value. + */ + AuthPlatform platform(); + + /** + * Gets the globalValidation property: The configuration settings that determines the validation flow of users using + * Service 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 Service Authentication/Authorization. + * + * @return the identityProviders value. + */ + IdentityProviders identityProviders(); + + /** + * Gets the login property: The configuration settings of the login flow of users using ContainerApp Service + * 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 Service 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.WithPlatform, + 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 platform. */ + interface WithPlatform { + /** + * Specifies the platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization.. + * + * @param platform The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * @return the next definition stage. + */ + WithCreate withPlatform(AuthPlatform platform); + } + /** 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 Service Authentication/Authorization.. + * + * @param globalValidation The configuration settings that determines the validation flow of users using + * Service 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 Service Authentication/Authorization.. + * + * @param identityProviders The configuration settings of each of the identity providers used to configure + * ContainerApp Service 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 + * Service Authentication/Authorization.. + * + * @param login The configuration settings of the login flow of users using ContainerApp Service + * 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 Service Authentication/Authorization.. + * + * @param httpSettings The configuration settings of the HTTP requests for authentication and authorization + * requests made against ContainerApp Service 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.WithPlatform, + 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 platform. */ + interface WithPlatform { + /** + * Specifies the platform property: The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization.. + * + * @param platform The configuration settings of the platform of ContainerApp Service + * Authentication/Authorization. + * @return the next definition stage. + */ + Update withPlatform(AuthPlatform platform); + } + /** 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 Service Authentication/Authorization.. + * + * @param globalValidation The configuration settings that determines the validation flow of users using + * Service 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 Service Authentication/Authorization.. + * + * @param identityProviders The configuration settings of each of the identity providers used to configure + * ContainerApp Service 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 + * Service Authentication/Authorization.. + * + * @param login The configuration settings of the login flow of users using ContainerApp Service + * 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 Service Authentication/Authorization.. + * + * @param httpSettings The configuration settings of the HTTP requests for authentication and authorization + * requests made against ContainerApp Service 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..bd73d36f4a99f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthConfigCollection.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.AuthConfigInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** AuthConfig collection ARM resource. */ +@Fluent +public final class AuthConfigCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AuthConfigCollection.class); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthPlatform.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthPlatform.java new file mode 100644 index 0000000000000..b32529a30b223 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AuthPlatform.java @@ -0,0 +1,82 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the platform of ContainerApp Service Authentication/Authorization. */ +@Fluent +public final class AuthPlatform { + /* + * true if the Authentication / Authorization feature is + * enabled for the current app; otherwise, false. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The RuntimeVersion of the Authentication / Authorization feature in use + * for the current app. + * The setting in this value can control the behavior of certain features + * in the Authentication / Authorization module. + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /** + * Get the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>false</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>true</code> if the Authentication / Authorization feature is enabled + * for the current app; otherwise, <code>false</code>. + * + * @param enabled the enabled value to set. + * @return the AuthPlatform object itself. + */ + public AuthPlatform withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the + * current app. The setting in this value can control the behavior of certain features in the Authentication / + * Authorization module. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: The RuntimeVersion of the Authentication / Authorization feature in use for the + * current app. The setting in this value can control the behavior of certain features in the Authentication / + * Authorization module. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the AuthPlatform object itself. + */ + public AuthPlatform withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + 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/AvailableOperations.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java new file mode 100644 index 0000000000000..35201c89973f7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java @@ -0,0 +1,80 @@ +// 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.resourcemanager.app.fluent.models.OperationDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Available operations of the service. */ +@Fluent +public final class AvailableOperations { + /* + * 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..1541f78679735 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectory.java @@ -0,0 +1,172 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Azure Active directory provider. */ +@Fluent +public final class AzureActiveDirectory { + /* + * false if the Azure Active Directory provider should not be + * enabled despite the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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; + + /* + * Gets a value indicating whether the Azure AD configuration was + * auto-provisioned using 1st party tooling. + * This is an internal flag primarily intended to support the Azure + * Management Portal. Users should not + * read or write to this property. + */ + @JsonProperty(value = "isAutoProvisioned") + private Boolean isAutoProvisioned; + + /** + * Get the enabled property: <code>false</code> if the Azure Active Directory provider should not be + * enabled despite the set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the Azure Active Directory provider should not be + * enabled despite the set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withEnabled(Boolean enabled) { + this.enabled = enabled; + 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; + } + + /** + * Get the isAutoProvisioned property: Gets a value indicating whether the Azure AD configuration was + * auto-provisioned using 1st party tooling. This is an internal flag primarily intended to support the Azure + * Management Portal. Users should not read or write to this property. + * + * @return the isAutoProvisioned value. + */ + public Boolean isAutoProvisioned() { + return this.isAutoProvisioned; + } + + /** + * Set the isAutoProvisioned property: Gets a value indicating whether the Azure AD configuration was + * auto-provisioned using 1st party tooling. This is an internal flag primarily intended to support the Azure + * Management Portal. Users should not read or write to this property. + * + * @param isAutoProvisioned the isAutoProvisioned value to set. + * @return the AzureActiveDirectory object itself. + */ + public AzureActiveDirectory withIsAutoProvisioned(Boolean isAutoProvisioned) { + this.isAutoProvisioned = isAutoProvisioned; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registration() != null) { + registration().validate(); + } + if (login() != null) { + login().validate(); + } + if (validation() != null) { + validation().validate(); + } + } +} 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..bf365c5405871 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryLogin.java @@ -0,0 +1,80 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Azure Active Directory login flow. */ +@Fluent +public final class AzureActiveDirectoryLogin { + /* + * 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 Boolean 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 Boolean 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(Boolean 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..745fc81936884 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryRegistration.java @@ -0,0 +1,225 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Azure Active Directory app registration. */ +@Fluent +public final class AzureActiveDirectoryRegistration { + /* + * 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 setting name that contains the client secret of the relying + * party application. + */ + @JsonProperty(value = "clientSecretSettingName") + private String clientSecretSettingName; + + /* + * 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 clientSecretSettingName property: The app setting name that contains the client secret of the relying + * party application. + * + * @return the clientSecretSettingName value. + */ + public String clientSecretSettingName() { + return this.clientSecretSettingName; + } + + /** + * Set the clientSecretSettingName property: The app setting name that contains the client secret of the relying + * party application. + * + * @param clientSecretSettingName the clientSecretSettingName value to set. + * @return the AzureActiveDirectoryRegistration object itself. + */ + public AzureActiveDirectoryRegistration withClientSecretSettingName(String clientSecretSettingName) { + this.clientSecretSettingName = clientSecretSettingName; + 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..75e9a9363f12e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureActiveDirectoryValidation.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Azure Active Directory token validation flow. */ +@Fluent +public final class AzureActiveDirectoryValidation { + /* + * The configuration settings of the checks that should be made while + * validating the JWT Claims. + */ + @JsonProperty(value = "jwtClaimChecks") + private JwtClaimChecks jwtClaimChecks; + + /* + * The list of audiences that can make successful + * authentication/authorization requests. + */ + @JsonProperty(value = "allowedAudiences") + private List allowedAudiences; + + /* + * The configuration settings of the default authorization policy. + */ + @JsonProperty(value = "defaultAuthorizationPolicy") + private DefaultAuthorizationPolicy defaultAuthorizationPolicy; + + /** + * Get the jwtClaimChecks property: The configuration settings of the checks that should be made while validating + * the JWT Claims. + * + * @return the jwtClaimChecks value. + */ + public JwtClaimChecks jwtClaimChecks() { + return this.jwtClaimChecks; + } + + /** + * Set the jwtClaimChecks property: The configuration settings of the checks that should be made while validating + * the JWT Claims. + * + * @param jwtClaimChecks the jwtClaimChecks value to set. + * @return the AzureActiveDirectoryValidation object itself. + */ + public AzureActiveDirectoryValidation withJwtClaimChecks(JwtClaimChecks jwtClaimChecks) { + this.jwtClaimChecks = jwtClaimChecks; + return this; + } + + /** + * 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; + } + + /** + * Get the defaultAuthorizationPolicy property: The configuration settings of the default authorization policy. + * + * @return the defaultAuthorizationPolicy value. + */ + public DefaultAuthorizationPolicy defaultAuthorizationPolicy() { + return this.defaultAuthorizationPolicy; + } + + /** + * Set the defaultAuthorizationPolicy property: The configuration settings of the default authorization policy. + * + * @param defaultAuthorizationPolicy the defaultAuthorizationPolicy value to set. + * @return the AzureActiveDirectoryValidation object itself. + */ + public AzureActiveDirectoryValidation withDefaultAuthorizationPolicy( + DefaultAuthorizationPolicy defaultAuthorizationPolicy) { + this.defaultAuthorizationPolicy = defaultAuthorizationPolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jwtClaimChecks() != null) { + jwtClaimChecks().validate(); + } + if (defaultAuthorizationPolicy() != null) { + defaultAuthorizationPolicy().validate(); + } + } +} 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..edeec7defce70 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App credentials. */ +@Fluent +public final class AzureCredentials { + /* + * 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..00cc7a95b65d7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure File Properties. */ +@Fluent +public final class AzureFileProperties { + /* + * 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/AzureStaticWebApps.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebApps.java new file mode 100644 index 0000000000000..7a904c32cfcf8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebApps.java @@ -0,0 +1,78 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Azure Static Web Apps provider. */ +@Fluent +public final class AzureStaticWebApps { + /* + * false if the Azure Static Web Apps provider should not be + * enabled despite the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The configuration settings of the Azure Static Web Apps registration. + */ + @JsonProperty(value = "registration") + private AzureStaticWebAppsRegistration registration; + + /** + * Get the enabled property: <code>false</code> if the Azure Static Web Apps provider should not be + * enabled despite the set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the Azure Static Web Apps provider should not be + * enabled despite the set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the AzureStaticWebApps object itself. + */ + public AzureStaticWebApps withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the registration property: The configuration settings of the Azure Static Web Apps registration. + * + * @return the registration value. + */ + public AzureStaticWebAppsRegistration 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 AzureStaticWebApps object itself. + */ + public AzureStaticWebApps withRegistration(AzureStaticWebAppsRegistration 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/AzureStaticWebAppsRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppsRegistration.java new file mode 100644 index 0000000000000..8189ce8fa0f39 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureStaticWebAppsRegistration.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the registration for the Azure Static Web Apps provider. */ +@Fluent +public final class AzureStaticWebAppsRegistration { + /* + * 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 AzureStaticWebAppsRegistration object itself. + */ + public AzureStaticWebAppsRegistration 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..907f20e0f4410 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateCollection.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.CertificateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Certificates. */ +@Fluent +public final class CertificateCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CertificateCollection.class); +} 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..5f989f3d116fa --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificatePatch.java @@ -0,0 +1,49 @@ +// 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.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A certificate to update. */ +@Fluent +public final class CertificatePatch { + /* + * 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..3af0a2646851c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProperties.java @@ -0,0 +1,194 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Certificate resource specific properties. */ +@Fluent +public final class CertificateProperties { + /* + * Provisioning state of the certificate. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CertificateProvisioningState provisioningState; + + /* + * 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 provisioningState property: Provisioning state of the certificate. + * + * @return the provisioningState value. + */ + public CertificateProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * 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/CertificateProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProvisioningState.java new file mode 100644 index 0000000000000..8797286444fa6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CertificateProvisioningState.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 CertificateProvisioningState. */ +public final class CertificateProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for CertificateProvisioningState. */ + public static final CertificateProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CertificateProvisioningState. */ + public static final CertificateProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for CertificateProvisioningState. */ + public static final CertificateProvisioningState CANCELED = fromString("Canceled"); + + /** Static value DeleteFailed for CertificateProvisioningState. */ + public static final CertificateProvisioningState DELETE_FAILED = fromString("DeleteFailed"); + + /** Static value Pending for CertificateProvisioningState. */ + public static final CertificateProvisioningState PENDING = fromString("Pending"); + + /** + * Creates or finds a CertificateProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateProvisioningState. + */ + @JsonCreator + public static CertificateProvisioningState fromString(String name) { + return fromString(name, CertificateProvisioningState.class); + } + + /** @return known CertificateProvisioningState values. */ + public static Collection values() { + return values(CertificateProvisioningState.class); + } +} 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/CheckNameAvailabilityReason.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityReason.java new file mode 100644 index 0000000000000..9dd61849e30ba --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityReason.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 CheckNameAvailabilityReason. */ +public final class CheckNameAvailabilityReason extends ExpandableStringEnum { + /** Static value Invalid for CheckNameAvailabilityReason. */ + public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); + + /** Static value AlreadyExists for CheckNameAvailabilityReason. */ + public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates or finds a CheckNameAvailabilityReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CheckNameAvailabilityReason. + */ + @JsonCreator + public static CheckNameAvailabilityReason fromString(String name) { + return fromString(name, CheckNameAvailabilityReason.class); + } + + /** @return known CheckNameAvailabilityReason values. */ + public static Collection values() { + return values(CheckNameAvailabilityReason.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityRequest.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityRequest.java new file mode 100644 index 0000000000000..a609204beb560 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityRequest.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The check availability request body. */ +@Fluent +public final class CheckNameAvailabilityRequest { + /* + * The name of the resource for which availability needs to be checked. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name property: The name of the resource for which availability needs to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource for which availability needs to be checked. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withType(String type) { + this.type = type; + 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/CheckNameAvailabilityResponse.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityResponse.java new file mode 100644 index 0000000000000..5003189791a1a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CheckNameAvailabilityResponse.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.models; + +import com.azure.resourcemanager.app.fluent.models.CheckNameAvailabilityResponseInner; + +/** An immutable client-side representation of CheckNameAvailabilityResponse. */ +public interface CheckNameAvailabilityResponse { + /** + * Gets the nameAvailable property: Indicates if the resource name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason why the given name is not available. + * + * @return the reason value. + */ + CheckNameAvailabilityReason reason(); + + /** + * Gets the message property: Detailed reason why the given name is available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.CheckNameAvailabilityResponseInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResponseInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientCredentialMethod.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientCredentialMethod.java new file mode 100644 index 0000000000000..ff2e1d1b361fa --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientCredentialMethod.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.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ClientCredentialMethod. */ +public enum ClientCredentialMethod { + /** Enum value ClientSecretPost. */ + CLIENT_SECRET_POST("ClientSecretPost"); + + /** The actual serialized value for a ClientCredentialMethod instance. */ + private final String value; + + ClientCredentialMethod(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ClientCredentialMethod instance. + * + * @param value the serialized value to parse. + * @return the parsed ClientCredentialMethod object, or null if unable to parse. + */ + @JsonCreator + public static ClientCredentialMethod fromString(String value) { + ClientCredentialMethod[] items = ClientCredentialMethod.values(); + for (ClientCredentialMethod 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/ClientRegistration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientRegistration.java new file mode 100644 index 0000000000000..ebb8048df8f8c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ClientRegistration.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.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * The Client ID of the app used for login. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The app setting name that contains the client secret. + */ + @JsonProperty(value = "clientSecretSettingName") + private String clientSecretSettingName; + + /** + * 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 clientSecretSettingName property: The app setting name that contains the client secret. + * + * @return the clientSecretSettingName value. + */ + public String clientSecretSettingName() { + return this.clientSecretSettingName; + } + + /** + * Set the clientSecretSettingName property: The app setting name that contains the client secret. + * + * @param clientSecretSettingName the clientSecretSettingName value to set. + * @return the ClientRegistration object itself. + */ + public ClientRegistration withClientSecretSettingName(String clientSecretSettingName) { + this.clientSecretSettingName = clientSecretSettingName; + 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..17ada5c7b68af --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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.Single: Only one revision can be active at a time. + * Revision weights can not be used in this mode. If no value if provided, + * this is the default. + */ + @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; + + /* + * Dapr configuration for the Container App. + */ + @JsonProperty(value = "dapr") + private Dapr dapr; + + /** + * 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.</item><item>Single: Only one revision can be active at a time. Revision weights can not be + * used in this mode. If no value if provided, this is the default.</item></list>. + * + * @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.</item><item>Single: Only one revision can be active at a time. Revision weights can not be + * used in this mode. If no value if provided, this is the default.</item></list>. + * + * @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; + } + + /** + * 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 Configuration object itself. + */ + public Configuration withDapr(Dapr dapr) { + this.dapr = dapr; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (ingress() != null) { + ingress().validate(); + } + if (registries() != null) { + registries().forEach(e -> e.validate()); + } + if (dapr() != null) { + dapr().validate(); + } + } +} 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..0ce6ff42d557b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java @@ -0,0 +1,241 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App container definition. */ +@Fluent +public final class Container { + /* + * 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..3978c64ba9439 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java @@ -0,0 +1,363 @@ +// 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, + UpdateStages.WithIdentity, + UpdateStages.WithConfiguration, + UpdateStages.WithTemplate { + /** + * 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: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ContainerApp update 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. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the ContainerApp update 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. + */ + Update withConfiguration(Configuration configuration); + } + /** The stage of the ContainerApp update 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. + */ + Update withTemplate(Template template); + } + } + /** + * 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..b9f2c3250926f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App collection ARM resource. */ +@Fluent +public final class ContainerAppCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppCollection.class); +} 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..0fab1887aa03a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbe.java @@ -0,0 +1,305 @@ +// 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.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 { + /* + * 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..ecabc44c1f608 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGet.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** HTTPGet specifies the http request to perform. */ +@Fluent +public final class ContainerAppProbeHttpGet { + /* + * 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..1783cd6ad8746 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeHttpGetHttpHeadersItem.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HTTPHeader describes a custom header to be used in HTTP probes. */ +@Fluent +public final class ContainerAppProbeHttpGetHttpHeadersItem { + /* + * 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")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppProbeHttpGetHttpHeadersItem.class); +} 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..ede82d656e567 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProbeTcpSocket.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.fasterxml.jackson.annotation.JsonProperty; + +/** TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported. */ +@Fluent +public final class ContainerAppProbeTcpSocket { + /* + * 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..ff42f2466f1c3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppSecret.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Secret. */ +@Immutable +public final class ContainerAppSecret { + /* + * 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..f905adb9f07be --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java @@ -0,0 +1,247 @@ +// 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; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; + +/** 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); + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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. + */ + void update(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope); + + /** + * Patches a Container App using JSON Merge Patch. + * + * @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. + */ + void update(String resourceGroupName, String name, ContainerAppInner 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. + */ + 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..b60b9b7287863 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.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, String filter, 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..434d2094327da --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container resource requirements. */ +@Fluent +public final class ContainerResources { + /* + * 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/CookieExpiration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CookieExpiration.java new file mode 100644 index 0000000000000..4354c9631af9d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CookieExpiration.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the session cookie's expiration. */ +@Fluent +public final class CookieExpiration { + /* + * The convention used when determining the session cookie's expiration. + */ + @JsonProperty(value = "convention") + private CookieExpirationConvention convention; + + /* + * The time after the request is made when the session cookie should + * expire. + */ + @JsonProperty(value = "timeToExpiration") + private String timeToExpiration; + + /** + * Get the convention property: The convention used when determining the session cookie's expiration. + * + * @return the convention value. + */ + public CookieExpirationConvention convention() { + return this.convention; + } + + /** + * Set the convention property: The convention used when determining the session cookie's expiration. + * + * @param convention the convention value to set. + * @return the CookieExpiration object itself. + */ + public CookieExpiration withConvention(CookieExpirationConvention convention) { + this.convention = convention; + return this; + } + + /** + * Get the timeToExpiration property: The time after the request is made when the session cookie should expire. + * + * @return the timeToExpiration value. + */ + public String timeToExpiration() { + return this.timeToExpiration; + } + + /** + * Set the timeToExpiration property: The time after the request is made when the session cookie should expire. + * + * @param timeToExpiration the timeToExpiration value to set. + * @return the CookieExpiration object itself. + */ + public CookieExpiration withTimeToExpiration(String timeToExpiration) { + this.timeToExpiration = timeToExpiration; + 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/CookieExpirationConvention.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CookieExpirationConvention.java new file mode 100644 index 0000000000000..2975bfd6fedaf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CookieExpirationConvention.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for CookieExpirationConvention. */ +public enum CookieExpirationConvention { + /** Enum value FixedTime. */ + FIXED_TIME("FixedTime"), + + /** Enum value IdentityProviderDerived. */ + IDENTITY_PROVIDER_DERIVED("IdentityProviderDerived"); + + /** The actual serialized value for a CookieExpirationConvention instance. */ + private final String value; + + CookieExpirationConvention(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CookieExpirationConvention instance. + * + * @param value the serialized value to parse. + * @return the parsed CookieExpirationConvention object, or null if unable to parse. + */ + @JsonCreator + public static CookieExpirationConvention fromString(String value) { + CookieExpirationConvention[] items = CookieExpirationConvention.values(); + for (CookieExpirationConvention 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/CustomDomain.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomDomain.java new file mode 100644 index 0000000000000..0b3b92ceca69d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomDomain.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom Domain of a Container App. */ +@Fluent +public final class CustomDomain { + /* + * Hostname. + */ + @JsonProperty(value = "name", required = true) + 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", required = true) + 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() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model CustomDomain")); + } + if (certificateId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property certificateId in model CustomDomain")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); +} 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..390a4c8c6610d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomHostnameAnalysisResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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..38ba75c5183f4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomOpenIdConnectProvider.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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the custom Open ID Connect provider. */ +@Fluent +public final class CustomOpenIdConnectProvider { + /* + * false if the custom Open ID provider provider should not be + * enabled; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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 enabled property: <code>false</code> if the custom Open ID provider provider should not be + * enabled; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the custom Open ID provider provider should not be + * enabled; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the CustomOpenIdConnectProvider object itself. + */ + public CustomOpenIdConnectProvider withEnabled(Boolean enabled) { + this.enabled = enabled; + 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..b9e976def6694 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.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.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 { + /* + * 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..62ca1581f183c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Dapr configuration. */ +@Fluent +public final class Dapr { + /* + * 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..50d22c43fc42e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponent.java @@ -0,0 +1,357 @@ +// 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.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); + + /** + * List secrets for a dapr component. + * + * @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 Secrets Collection ARM resource. + */ + DaprSecretsCollection listSecrets(); + + /** + * List secrets for a 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 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/DaprComponents.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponents.java new file mode 100644 index 0000000000000..c669f0d1509d2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponents.java @@ -0,0 +1,184 @@ +// 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); + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource. + */ + DaprSecretsCollection listSecrets(String resourceGroupName, String environmentName, String name); + + /** + * List secrets for a dapr component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param 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 dapr component Secrets Collection ARM resource along with {@link Response}. + */ + Response listSecretsWithResponse( + 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..fbf0d5bdc75a1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprComponentsCollection.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.DaprComponentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dapr Components ARM resource. */ +@Fluent +public final class DaprComponentsCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DaprComponentsCollection.class); +} 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..4d96b6498521d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprMetadata.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dapr component metadata. */ +@Fluent +public final class DaprMetadata { + /* + * 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/DaprSecretsCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprSecretsCollection.java new file mode 100644 index 0000000000000..26f19f4a6c2d6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DaprSecretsCollection.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.DaprSecretsCollectionInner; +import java.util.List; + +/** An immutable client-side representation of DaprSecretsCollection. */ +public interface DaprSecretsCollection { + /** + * Gets the value property: Collection of secrets used by a Dapr component. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.DaprSecretsCollectionInner object. + * + * @return the inner object. + */ + DaprSecretsCollectionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultAuthorizationPolicy.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultAuthorizationPolicy.java new file mode 100644 index 0000000000000..97153c697acab --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultAuthorizationPolicy.java @@ -0,0 +1,80 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the Azure Active Directory default authorization policy. */ +@Fluent +public final class DefaultAuthorizationPolicy { + /* + * The configuration settings of the Azure Active Directory allowed + * principals. + */ + @JsonProperty(value = "allowedPrincipals") + private AllowedPrincipals allowedPrincipals; + + /* + * The configuration settings of the Azure Active Directory allowed + * applications. + */ + @JsonProperty(value = "allowedApplications") + private List allowedApplications; + + /** + * Get the allowedPrincipals property: The configuration settings of the Azure Active Directory allowed principals. + * + * @return the allowedPrincipals value. + */ + public AllowedPrincipals allowedPrincipals() { + return this.allowedPrincipals; + } + + /** + * Set the allowedPrincipals property: The configuration settings of the Azure Active Directory allowed principals. + * + * @param allowedPrincipals the allowedPrincipals value to set. + * @return the DefaultAuthorizationPolicy object itself. + */ + public DefaultAuthorizationPolicy withAllowedPrincipals(AllowedPrincipals allowedPrincipals) { + this.allowedPrincipals = allowedPrincipals; + return this; + } + + /** + * Get the allowedApplications property: The configuration settings of the Azure Active Directory allowed + * applications. + * + * @return the allowedApplications value. + */ + public List allowedApplications() { + return this.allowedApplications; + } + + /** + * Set the allowedApplications property: The configuration settings of the Azure Active Directory allowed + * applications. + * + * @param allowedApplications the allowedApplications value to set. + * @return the DefaultAuthorizationPolicy object itself. + */ + public DefaultAuthorizationPolicy withAllowedApplications(List allowedApplications) { + this.allowedApplications = allowedApplications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allowedPrincipals() != null) { + allowedPrincipals().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..f009b53288fe5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java @@ -0,0 +1,36 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** App Service error response. */ +@Immutable +public final class DefaultErrorResponseError extends ManagementError { + /* + * 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/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/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..de082b3705512 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container environment variable. */ +@Fluent +public final class EnvironmentVar { + /* + * 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..4418a71adb470 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Facebook.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Facebook provider. */ +@Fluent +public final class Facebook { + /* + * false if the Facebook provider should not be enabled + * despite the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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 enabled property: <code>false</code> if the Facebook provider should not be enabled despite + * the set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the Facebook provider should not be enabled despite + * the set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the Facebook object itself. + */ + public Facebook withEnabled(Boolean enabled) { + this.enabled = enabled; + 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/ForwardProxy.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ForwardProxy.java new file mode 100644 index 0000000000000..12a1f0d64c33e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ForwardProxy.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of a forward proxy used to make the requests. */ +@Fluent +public final class ForwardProxy { + /* + * The convention used to determine the url of the request made. + */ + @JsonProperty(value = "convention") + private ForwardProxyConvention convention; + + /* + * The name of the header containing the host of the request. + */ + @JsonProperty(value = "customHostHeaderName") + private String customHostHeaderName; + + /* + * The name of the header containing the scheme of the request. + */ + @JsonProperty(value = "customProtoHeaderName") + private String customProtoHeaderName; + + /** + * Get the convention property: The convention used to determine the url of the request made. + * + * @return the convention value. + */ + public ForwardProxyConvention convention() { + return this.convention; + } + + /** + * Set the convention property: The convention used to determine the url of the request made. + * + * @param convention the convention value to set. + * @return the ForwardProxy object itself. + */ + public ForwardProxy withConvention(ForwardProxyConvention convention) { + this.convention = convention; + return this; + } + + /** + * Get the customHostHeaderName property: The name of the header containing the host of the request. + * + * @return the customHostHeaderName value. + */ + public String customHostHeaderName() { + return this.customHostHeaderName; + } + + /** + * Set the customHostHeaderName property: The name of the header containing the host of the request. + * + * @param customHostHeaderName the customHostHeaderName value to set. + * @return the ForwardProxy object itself. + */ + public ForwardProxy withCustomHostHeaderName(String customHostHeaderName) { + this.customHostHeaderName = customHostHeaderName; + return this; + } + + /** + * Get the customProtoHeaderName property: The name of the header containing the scheme of the request. + * + * @return the customProtoHeaderName value. + */ + public String customProtoHeaderName() { + return this.customProtoHeaderName; + } + + /** + * Set the customProtoHeaderName property: The name of the header containing the scheme of the request. + * + * @param customProtoHeaderName the customProtoHeaderName value to set. + * @return the ForwardProxy object itself. + */ + public ForwardProxy withCustomProtoHeaderName(String customProtoHeaderName) { + this.customProtoHeaderName = customProtoHeaderName; + 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/ForwardProxyConvention.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ForwardProxyConvention.java new file mode 100644 index 0000000000000..86d6bee005a72 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ForwardProxyConvention.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 ForwardProxyConvention. */ +public enum ForwardProxyConvention { + /** Enum value NoProxy. */ + NO_PROXY("NoProxy"), + + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Custom. */ + CUSTOM("Custom"); + + /** The actual serialized value for a ForwardProxyConvention instance. */ + private final String value; + + ForwardProxyConvention(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ForwardProxyConvention instance. + * + * @param value the serialized value to parse. + * @return the parsed ForwardProxyConvention object, or null if unable to parse. + */ + @JsonCreator + public static ForwardProxyConvention fromString(String value) { + ForwardProxyConvention[] items = ForwardProxyConvention.values(); + for (ForwardProxyConvention 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/GitHub.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GitHub.java new file mode 100644 index 0000000000000..d59dc9da4c921 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GitHub.java @@ -0,0 +1,108 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the GitHub provider. */ +@Fluent +public final class GitHub { + /* + * false if the GitHub provider should not be enabled despite + * the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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 enabled property: <code>false</code> if the GitHub provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the GitHub provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the GitHub object itself. + */ + public GitHub withEnabled(Boolean enabled) { + this.enabled = enabled; + 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..86068c077effe --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties that define the mutable settings of a Container App SourceControl. */ +@Fluent +public final class GithubActionConfiguration { + /* + * Registry configurations. + */ + @JsonProperty(value = "registryInfo") + private RegistryInfo registryInfo; + + /* + * AzureCredentials configurations. + */ + @JsonProperty(value = "azureCredentials") + private AzureCredentials azureCredentials; + + /* + * Context path + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /* + * Image name + */ + @JsonProperty(value = "image") + private String image; + + /* + * 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 contextPath property: Context path. + * + * @return the contextPath value. + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the contextPath property: Context path. + * + * @param contextPath the contextPath value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the image property: Image name. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: Image name. + * + * @param image the image value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withImage(String image) { + this.image = image; + 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..e6b59910cfa5c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GlobalValidation.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The configuration settings that determines the validation flow of users using ContainerApp Service + * Authentication/Authorization. + */ +@Fluent +public final class GlobalValidation { + /* + * The action to take when an unauthenticated client attempts to access the + * app. + */ + @JsonProperty(value = "unauthenticatedClientAction") + private UnauthenticatedClientActionV2 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; + + /* + * The paths for which unauthenticated flow would not be redirected to the + * login page. + */ + @JsonProperty(value = "excludedPaths") + private List excludedPaths; + + /** + * Get the unauthenticatedClientAction property: The action to take when an unauthenticated client attempts to + * access the app. + * + * @return the unauthenticatedClientAction value. + */ + public UnauthenticatedClientActionV2 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(UnauthenticatedClientActionV2 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; + } + + /** + * Get the excludedPaths property: The paths for which unauthenticated flow would not be redirected to the login + * page. + * + * @return the excludedPaths value. + */ + public List excludedPaths() { + return this.excludedPaths; + } + + /** + * Set the excludedPaths property: The paths for which unauthenticated flow would not be redirected to the login + * page. + * + * @param excludedPaths the excludedPaths value to set. + * @return the GlobalValidation object itself. + */ + public GlobalValidation withExcludedPaths(List excludedPaths) { + this.excludedPaths = excludedPaths; + 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..d2c6239625827 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Google.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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Google provider. */ +@Fluent +public final class Google { + /* + * false if the Google provider should not be enabled despite + * the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * 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 enabled property: <code>false</code> if the Google provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the Google provider should not be enabled despite the + * set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the Google object itself. + */ + public Google withEnabled(Boolean enabled) { + this.enabled = enabled; + 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..17e85d230f099 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.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.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 { + /* + * 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..6d8afa06c2de7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettings.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.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration settings of the HTTP requests for authentication and authorization requests made against + * ContainerApp Service Authentication/Authorization. + */ +@Fluent +public final class HttpSettings { + /* + * false if the authentication/authorization responses not + * having the HTTPS scheme are permissible; otherwise, true. + */ + @JsonProperty(value = "requireHttps") + private Boolean requireHttps; + + /* + * The configuration settings of the paths HTTP requests. + */ + @JsonProperty(value = "routes") + private HttpSettingsRoutes routes; + + /* + * The configuration settings of a forward proxy used to make the requests. + */ + @JsonProperty(value = "forwardProxy") + private ForwardProxy forwardProxy; + + /** + * 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 Boolean 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(Boolean requireHttps) { + this.requireHttps = requireHttps; + return this; + } + + /** + * Get the routes property: The configuration settings of the paths HTTP requests. + * + * @return the routes value. + */ + public HttpSettingsRoutes routes() { + return this.routes; + } + + /** + * Set the routes property: The configuration settings of the paths HTTP requests. + * + * @param routes the routes value to set. + * @return the HttpSettings object itself. + */ + public HttpSettings withRoutes(HttpSettingsRoutes routes) { + this.routes = routes; + return this; + } + + /** + * Get the forwardProxy property: The configuration settings of a forward proxy used to make the requests. + * + * @return the forwardProxy value. + */ + public ForwardProxy forwardProxy() { + return this.forwardProxy; + } + + /** + * Set the forwardProxy property: The configuration settings of a forward proxy used to make the requests. + * + * @param forwardProxy the forwardProxy value to set. + * @return the HttpSettings object itself. + */ + public HttpSettings withForwardProxy(ForwardProxy forwardProxy) { + this.forwardProxy = forwardProxy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().validate(); + } + if (forwardProxy() != null) { + forwardProxy().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoutes.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoutes.java new file mode 100644 index 0000000000000..c7af00cf7eba0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpSettingsRoutes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the paths HTTP requests. */ +@Fluent +public final class HttpSettingsRoutes { + /* + * 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 HttpSettingsRoutes object itself. + */ + public HttpSettingsRoutes 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/IdentityProviders.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviders.java new file mode 100644 index 0000000000000..90e0ea83a4361 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IdentityProviders.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +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 Service + * Authentication/Authorization. + */ +@Fluent +public final class IdentityProviders { + /* + * 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 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 = "azureStaticWebApps") + private AzureStaticWebApps azureStaticWebApps; + + /* + * 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 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 azureStaticWebApps property: The configuration settings of the Azure Static Web Apps provider. + * + * @return the azureStaticWebApps value. + */ + public AzureStaticWebApps azureStaticWebApps() { + return this.azureStaticWebApps; + } + + /** + * Set the azureStaticWebApps property: The configuration settings of the Azure Static Web Apps provider. + * + * @param azureStaticWebApps the azureStaticWebApps value to set. + * @return the IdentityProviders object itself. + */ + public IdentityProviders withAzureStaticWebApps(AzureStaticWebApps azureStaticWebApps) { + this.azureStaticWebApps = azureStaticWebApps; + 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 (twitter() != null) { + twitter().validate(); + } + if (apple() != null) { + apple().validate(); + } + if (azureStaticWebApps() != null) { + azureStaticWebApps().validate(); + } + if (customOpenIdConnectProviders() != null) { + customOpenIdConnectProviders() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} 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..87843e5cc0275 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Ingress configuration. */ +@Fluent +public final class Ingress { + /* + * 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/JwtClaimChecks.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/JwtClaimChecks.java new file mode 100644 index 0000000000000..10da85c058e89 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/JwtClaimChecks.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the checks that should be made while validating the JWT Claims. */ +@Fluent +public final class JwtClaimChecks { + /* + * The list of the allowed groups. + */ + @JsonProperty(value = "allowedGroups") + private List allowedGroups; + + /* + * The list of the allowed client applications. + */ + @JsonProperty(value = "allowedClientApplications") + private List allowedClientApplications; + + /** + * Get the allowedGroups property: The list of the allowed groups. + * + * @return the allowedGroups value. + */ + public List allowedGroups() { + return this.allowedGroups; + } + + /** + * Set the allowedGroups property: The list of the allowed groups. + * + * @param allowedGroups the allowedGroups value to set. + * @return the JwtClaimChecks object itself. + */ + public JwtClaimChecks withAllowedGroups(List allowedGroups) { + this.allowedGroups = allowedGroups; + return this; + } + + /** + * Get the allowedClientApplications property: The list of the allowed client applications. + * + * @return the allowedClientApplications value. + */ + public List allowedClientApplications() { + return this.allowedClientApplications; + } + + /** + * Set the allowedClientApplications property: The list of the allowed client applications. + * + * @param allowedClientApplications the allowedClientApplications value to set. + * @return the JwtClaimChecks object itself. + */ + public JwtClaimChecks withAllowedClientApplications(List allowedClientApplications) { + this.allowedClientApplications = allowedClientApplications; + 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/LogAnalyticsConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java new file mode 100644 index 0000000000000..489b294725f14 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log analytics configuration. */ +@Fluent +public final class LogAnalyticsConfiguration { + /* + * 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..7d78993a33525 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Login.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The configuration settings of the login flow of users using ContainerApp Service Authentication/Authorization. */ +@Fluent +public final class Login { + /* + * The routes that specify the endpoints used for login and logout + * requests. + */ + @JsonProperty(value = "routes") + private LoginRoutes routes; + + /* + * true if the fragments from the request are preserved after + * the login request is made; otherwise, false. + */ + @JsonProperty(value = "preserveUrlFragmentsForLogins") + private Boolean 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; + + /* + * The configuration settings of the session cookie's expiration. + */ + @JsonProperty(value = "cookieExpiration") + private CookieExpiration cookieExpiration; + + /* + * The configuration settings of the nonce used in the login flow. + */ + @JsonProperty(value = "nonce") + private Nonce nonce; + + /** + * Get the routes property: The routes that specify the endpoints used for login and logout requests. + * + * @return the routes value. + */ + public LoginRoutes routes() { + return this.routes; + } + + /** + * Set the routes property: The routes that specify the endpoints used for login and logout requests. + * + * @param routes the routes value to set. + * @return the Login object itself. + */ + public Login withRoutes(LoginRoutes routes) { + this.routes = routes; + 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 Boolean 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(Boolean 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; + } + + /** + * Get the cookieExpiration property: The configuration settings of the session cookie's expiration. + * + * @return the cookieExpiration value. + */ + public CookieExpiration cookieExpiration() { + return this.cookieExpiration; + } + + /** + * Set the cookieExpiration property: The configuration settings of the session cookie's expiration. + * + * @param cookieExpiration the cookieExpiration value to set. + * @return the Login object itself. + */ + public Login withCookieExpiration(CookieExpiration cookieExpiration) { + this.cookieExpiration = cookieExpiration; + return this; + } + + /** + * Get the nonce property: The configuration settings of the nonce used in the login flow. + * + * @return the nonce value. + */ + public Nonce nonce() { + return this.nonce; + } + + /** + * Set the nonce property: The configuration settings of the nonce used in the login flow. + * + * @param nonce the nonce value to set. + * @return the Login object itself. + */ + public Login withNonce(Nonce nonce) { + this.nonce = nonce; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (routes() != null) { + routes().validate(); + } + if (cookieExpiration() != null) { + cookieExpiration().validate(); + } + if (nonce() != null) { + nonce().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoutes.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoutes.java new file mode 100644 index 0000000000000..7055ec800b5e7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginRoutes.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The routes that specify the endpoints used for login and logout requests. */ +@Fluent +public final class LoginRoutes { + /* + * 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 LoginRoutes object itself. + */ + public LoginRoutes 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..e3d2cca4731c7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LoginScopes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +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 { + /* + * 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..c4fe99f505278 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java @@ -0,0 +1,330 @@ +// 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 zoneRedundant property: Whether or not this Managed Environment is zone-redundant. + * + * @return the zoneRedundant value. + */ + Boolean zoneRedundant(); + + /** + * 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, + DefinitionStages.WithZoneRedundant { + /** + * 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); + } + /** The stage of the ManagedEnvironment definition allowing to specify zoneRedundant. */ + interface WithZoneRedundant { + /** + * Specifies the zoneRedundant property: Whether or not this Managed Environment is zone-redundant.. + * + * @param zoneRedundant Whether or not this Managed Environment is zone-redundant. + * @return the next definition stage. + */ + WithCreate withZoneRedundant(Boolean zoneRedundant); + } + } + /** + * 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, UpdateStages.WithVnetConfiguration, UpdateStages.WithAppLogsConfiguration { + /** + * 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: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ManagedEnvironment update 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. + */ + Update withVnetConfiguration(VnetConfiguration vnetConfiguration); + } + /** The stage of the ManagedEnvironment update 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. + */ + Update withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration); + } + } + /** + * 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/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..262c2d22b9b0a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java @@ -0,0 +1,49 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Storage properties. */ +@Fluent +public final class ManagedEnvironmentStorageProperties { + /* + * 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..48c2e1737ab2d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.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.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; + +/** 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); + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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. + */ + void update(String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope); + + /** + * Patches a Managed Environment using JSON Merge Patch. + * + * @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. + */ + void update(String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, 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..8c796144f8cc2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.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.ManagedEnvironmentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Environments. */ +@Fluent +public final class ManagedEnvironmentsCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedEnvironmentsCollection.class); +} 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..f020ce5c7513e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedServiceIdentity.java @@ -0,0 +1,141 @@ +// 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.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 { + /* + * 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(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} 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/Namespaces.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Namespaces.java new file mode 100644 index 0000000000000..cf0dcccead3f5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Namespaces.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Namespaces. */ +public interface Namespaces { + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @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 check availability result. + */ + CheckNameAvailabilityResponse checkNameAvailability( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest); + + /** + * Checks if resource name is available. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param managedEnvironmentName Name of the Managed Environment. + * @param checkNameAvailabilityRequest The check name availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.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 check availability result along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + String resourceGroupName, + String managedEnvironmentName, + CheckNameAvailabilityRequest checkNameAvailabilityRequest, + Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Nonce.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Nonce.java new file mode 100644 index 0000000000000..c9b44faec7ab6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Nonce.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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the nonce used in the login flow. */ +@Fluent +public final class Nonce { + /* + * false if the nonce should not be validated while completing + * the login flow; otherwise, true. + */ + @JsonProperty(value = "validateNonce") + private Boolean validateNonce; + + /* + * The time after the request is made when the nonce should expire. + */ + @JsonProperty(value = "nonceExpirationInterval") + private String nonceExpirationInterval; + + /** + * Get the validateNonce property: <code>false</code> if the nonce should not be validated while + * completing the login flow; otherwise, <code>true</code>. + * + * @return the validateNonce value. + */ + public Boolean validateNonce() { + return this.validateNonce; + } + + /** + * Set the validateNonce property: <code>false</code> if the nonce should not be validated while + * completing the login flow; otherwise, <code>true</code>. + * + * @param validateNonce the validateNonce value to set. + * @return the Nonce object itself. + */ + public Nonce withValidateNonce(Boolean validateNonce) { + this.validateNonce = validateNonce; + return this; + } + + /** + * Get the nonceExpirationInterval property: The time after the request is made when the nonce should expire. + * + * @return the nonceExpirationInterval value. + */ + public String nonceExpirationInterval() { + return this.nonceExpirationInterval; + } + + /** + * Set the nonceExpirationInterval property: The time after the request is made when the nonce should expire. + * + * @param nonceExpirationInterval the nonceExpirationInterval value to set. + * @return the Nonce object itself. + */ + public Nonce withNonceExpirationInterval(String nonceExpirationInterval) { + this.nonceExpirationInterval = nonceExpirationInterval; + 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/OpenIdConnectClientCredential.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectClientCredential.java new file mode 100644 index 0000000000000..3fddfd909b40e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectClientCredential.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.fasterxml.jackson.annotation.JsonProperty; + +/** The authentication client credentials of the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectClientCredential { + /* + * The method that should be used to authenticate the user. + */ + @JsonProperty(value = "method") + private ClientCredentialMethod method; + + /* + * The app setting that contains the client secret for the custom Open ID + * Connect provider. + */ + @JsonProperty(value = "clientSecretSettingName") + private String clientSecretSettingName; + + /** + * Get the method property: The method that should be used to authenticate the user. + * + * @return the method value. + */ + public ClientCredentialMethod method() { + return this.method; + } + + /** + * Set the method property: The method that should be used to authenticate the user. + * + * @param method the method value to set. + * @return the OpenIdConnectClientCredential object itself. + */ + public OpenIdConnectClientCredential withMethod(ClientCredentialMethod method) { + this.method = method; + return this; + } + + /** + * Get the clientSecretSettingName property: The app setting that contains the client secret for the custom Open ID + * Connect provider. + * + * @return the clientSecretSettingName value. + */ + public String clientSecretSettingName() { + return this.clientSecretSettingName; + } + + /** + * Set the clientSecretSettingName property: The app setting that contains the client secret for the custom Open ID + * Connect provider. + * + * @param clientSecretSettingName the clientSecretSettingName value to set. + * @return the OpenIdConnectClientCredential object itself. + */ + public OpenIdConnectClientCredential withClientSecretSettingName(String clientSecretSettingName) { + this.clientSecretSettingName = clientSecretSettingName; + 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..dd0495725bd64 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectConfig.java @@ -0,0 +1,153 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the endpoints used for the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectConfig { + /* + * 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..41d1b8de6147a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectLogin.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.annotation.Fluent; +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 { + /* + * 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..8eba8f2c93ac2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OpenIdConnectRegistration.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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the app registration for the custom Open ID Connect provider. */ +@Fluent +public final class OpenIdConnectRegistration { + /* + * 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..d0d148aadd516 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Fluent +public final class OperationDisplay { + /* + * 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/QueueScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java new file mode 100644 index 0000000000000..dc2a15a75c416 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App container Azure Queue based scaling rule. */ +@Fluent +public final class QueueScaleRule { + /* + * 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..0c6f8488b6b40 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Private Registry. */ +@Fluent +public final class RegistryCredentials { + /* + * 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..c7b82dc6ac75e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App registry information. */ +@Fluent +public final class RegistryInfo { + /* + * 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..40f399d7d8105 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java @@ -0,0 +1,150 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** Container object under Container App Revision Replica. */ +@Fluent +public final class ReplicaContainer { + /* + * 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/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..bfcfd2ceaaa20 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Revisions collection ARM resource. */ +@Fluent +public final class RevisionCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RevisionCollection.class); +} 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..77b8d2b3f0356 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App scaling configurations. */ +@Fluent +public final class Scale { + /* + * 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..9386573a4fd11 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container scaling rule. */ +@Fluent +public final class ScaleRule { + /* + * 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..dca4fa7c64d92 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Auth Secrets for Container App Scale Rule. */ +@Fluent +public final class ScaleRuleAuth { + /* + * 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..e0986da28386e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Secret definition. */ +@Fluent +public final class Secret { + /* + * 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..6a4a6b80c6dbc --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SourceControl collection ARM resource. */ +@Fluent +public final class SourceControlCollection { + /* + * 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()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SourceControlCollection.class); +} 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..481176f1bf05a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.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.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 { + /* + * 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; + + /* + * 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 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 (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..9f136b7d9533d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Traffic weight assigned to a revision. */ +@Fluent +public final class TrafficWeight { + /* + * 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; + + /* + * Associates a traffic label with a revision + */ + @JsonProperty(value = "label") + private String label; + + /** + * 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; + } + + /** + * Get the label property: Associates a traffic label with a revision. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Associates a traffic label with a revision. + * + * @param label the label value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withLabel(String label) { + this.label = label; + 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..2a09003107f9e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Twitter.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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the Twitter provider. */ +@Fluent +public final class Twitter { + /* + * false if the Twitter provider should not be enabled despite + * the set registration; otherwise, true. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The configuration settings of the app registration for the Twitter + * provider. + */ + @JsonProperty(value = "registration") + private TwitterRegistration registration; + + /** + * Get the enabled property: <code>false</code> if the Twitter provider should not be enabled despite + * the set registration; otherwise, <code>true</code>. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: <code>false</code> if the Twitter provider should not be enabled despite + * the set registration; otherwise, <code>true</code>. + * + * @param enabled the enabled value to set. + * @return the Twitter object itself. + */ + public Twitter withEnabled(Boolean enabled) { + this.enabled = enabled; + 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..aa9392b2d77e7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TwitterRegistration.java @@ -0,0 +1,82 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The configuration settings of the app registration for the Twitter provider. */ +@Fluent +public final class TwitterRegistration { + /* + * 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 setting name that contains the OAuth 1.0a consumer secret of the + * Twitter + * application used for sign-in. + */ + @JsonProperty(value = "consumerSecretSettingName") + private String consumerSecretSettingName; + + /** + * 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 consumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer secret of + * the Twitter application used for sign-in. + * + * @return the consumerSecretSettingName value. + */ + public String consumerSecretSettingName() { + return this.consumerSecretSettingName; + } + + /** + * Set the consumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer secret of + * the Twitter application used for sign-in. + * + * @param consumerSecretSettingName the consumerSecretSettingName value to set. + * @return the TwitterRegistration object itself. + */ + public TwitterRegistration withConsumerSecretSettingName(String consumerSecretSettingName) { + this.consumerSecretSettingName = consumerSecretSettingName; + 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/UnauthenticatedClientActionV2.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UnauthenticatedClientActionV2.java new file mode 100644 index 0000000000000..ca39d30ace8b3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UnauthenticatedClientActionV2.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.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for UnauthenticatedClientActionV2. */ +public enum UnauthenticatedClientActionV2 { + /** Enum value RedirectToLoginPage. */ + REDIRECT_TO_LOGIN_PAGE("RedirectToLoginPage"), + + /** Enum value AllowAnonymous. */ + ALLOW_ANONYMOUS("AllowAnonymous"), + + /** Enum value Return401. */ + RETURN401("Return401"), + + /** Enum value Return403. */ + RETURN403("Return403"); + + /** The actual serialized value for a UnauthenticatedClientActionV2 instance. */ + private final String value; + + UnauthenticatedClientActionV2(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UnauthenticatedClientActionV2 instance. + * + * @param value the serialized value to parse. + * @return the parsed UnauthenticatedClientActionV2 object, or null if unable to parse. + */ + @JsonCreator + public static UnauthenticatedClientActionV2 fromString(String value) { + UnauthenticatedClientActionV2[] items = UnauthenticatedClientActionV2.values(); + for (UnauthenticatedClientActionV2 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/UserAssignedIdentity.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..de6b858ede509 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/UserAssignedIdentity.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.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public class UserAssignedIdentity { + /* + * 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..268829e1456b4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.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.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties for apps environment to join a Virtual Network. */ +@Fluent +public final class VnetConfiguration { + /* + * 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..cfe0ba48a6ef0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Volume.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume definitions for the Container App. */ +@Fluent +public final class Volume { + /* + * 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..2f04d42a645bd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VolumeMount.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.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume mount for the Container App. */ +@Fluent +public final class VolumeMount { + /* + * 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..42f07be548786 --- /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/stable/2022-03-01/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..16a7893e23496 --- /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/stable/2022-03-01/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..a790a7174e21c --- /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/stable/2022-03-01/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..f39b5a19c8f13 --- /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/stable/2022-03-01/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..8415581e137c7 --- /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/stable/2022-03-01/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..285e738bf0d43 --- /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.AuthPlatform; +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.UnauthenticatedClientActionV2; + +/** Samples for ContainerAppsAuthConfigs CreateOrUpdate. */ +public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/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") + .withPlatform(new AuthPlatform().withEnabled(true)) + .withGlobalValidation( + new GlobalValidation().withUnauthenticatedClientAction(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS)) + .withIdentityProviders( + new IdentityProviders() + .withFacebook( + new Facebook() + .withRegistration( + new AppRegistration().withAppId("123").withAppSecretSettingName("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..08efe69bc75ac --- /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/stable/2022-03-01/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..56adce511c7bf --- /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/stable/2022-03-01/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..3f63bdf64c8e0 --- /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/stable/2022-03-01/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..99b35939cc9b8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.TrafficWeight; +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/stable/2022-03-01/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) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains( + Arrays + .asList( + new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain() + .withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .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"))))))) + .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..decd6cbb4de6e --- /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/stable/2022-03-01/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..be1b3ef116899 --- /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/stable/2022-03-01/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..72466cc1312c9 --- /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/stable/2022-03-01/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..4e05b9eff707e --- /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/stable/2022-03-01/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..61706255781de --- /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/stable/2022-03-01/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..22662cae6816f --- /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/stable/2022-03-01/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..e4e146bc748f1 --- /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/stable/2022-03-01/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..01eea3e24b813 --- /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/stable/2022-03-01/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..e3a0c78b7ebd1 --- /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/stable/2022-03-01/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..85aa1a7f15184 --- /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/stable/2022-03-01/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..eb7cf50330047 --- /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/stable/2022-03-01/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..fddce31b8596b --- /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/stable/2022-03-01/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", null, 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..884b1ed033b51 --- /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/stable/2022-03-01/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..59d7b993cb14e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.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.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/stable/2022-03-01/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("")) + .withContextPath("./") + .withImage("image/tag")) + .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..eb56869a7bab8 --- /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/stable/2022-03-01/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..d004917c4238a --- /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/stable/2022-03-01/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..3358c773d6f19 --- /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/stable/2022-03-01/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..827db20e27c1b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +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.TrafficWeight; +import com.azure.resourcemanager.app.models.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps Update. */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/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) { + manager + .containerApps() + .update( + "rg", + "testcontainerApp0", + new ContainerAppInner() + .withLocation("East US") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains( + Arrays + .asList( + new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain() + .withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com")))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .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"))))))), + Context.NONE); + } + + @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..cb7b15df2d994 --- /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/stable/2022-03-01/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..c5010aa431ab3 --- /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/stable/2022-03-01/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..5b1aa47bef4f0 --- /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/stable/2022-03-01/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..7fc680727b476 --- /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/stable/2022-03-01/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/DaprComponentsListSecretsSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsListSecretsSamples.java new file mode 100644 index 0000000000000..4c5d1cce7c819 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/DaprComponentsListSecretsSamples.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 ListSecrets. */ +public final class DaprComponentsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_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.daprComponents().listSecretsWithResponse("examplerg", "myenvironment", "reddog", 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..3e98d97185553 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.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.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/stable/2022-03-01/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"))) + .withZoneRedundant(true) + .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..b39c672e078cd --- /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/stable/2022-03-01/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..12661e4983e33 --- /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/stable/2022-03-01/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..ae18a2c76f9cd --- /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/stable/2022-03-01/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..7bb021741b2f7 --- /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/stable/2022-03-01/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..7f27c690255bb --- /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/stable/2022-03-01/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..d921a04ea0fcb --- /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/stable/2022-03-01/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..e2f93093adb5f --- /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/stable/2022-03-01/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..cdd2dad8e5498 --- /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/stable/2022-03-01/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..a4d60e93faf91 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +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/stable/2022-03-01/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) { + manager + .managedEnvironments() + .update( + "examplerg", + "testcontainerenv", + new ManagedEnvironmentInner() + .withLocation("East US") + .withTags(mapOf("tag1", "value1", "tag2", "value2")), + Context.NONE); + } + + @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/NamespacesCheckNameAvailabilitySamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/NamespacesCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..775b94686a81d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/NamespacesCheckNameAvailabilitySamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.CheckNameAvailabilityRequest; + +/** Samples for Namespaces CheckNameAvailability. */ +public final class NamespacesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json + */ + /** + * Sample code: Certificates_CheckNameAvailability. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void certificatesCheckNameAvailability( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + "examplerg", + "testcontainerenv", + new CheckNameAvailabilityRequest() + .withName("testcertificatename") + .withType("Microsoft.App/managedEnvironments/certificates"), + Context.NONE); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json + */ + /** + * Sample code: ContainerApps_CheckNameAvailability. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void containerAppsCheckNameAvailability( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .namespaces() + .checkNameAvailabilityWithResponse( + "examplerg", + "testcontainerenv", + new CheckNameAvailabilityRequest().withName("testcappname").withType("Microsoft.App/containerApps"), + Context.NONE); + } +} 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..68a2f87d7d760 --- /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/stable/2022-03-01/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 + + + +