From d28050b0da602b7a9aac0469acfde1bee59f5c3d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 12 Feb 2025 00:40:05 +0000 Subject: [PATCH] CodeGen from PR 32506 in Azure/azure-rest-api-specs Merge c9c8f78644a0c8af230228a4db0b2d2cf562226a into 6b9d2ce84dfe5ddfec54cbf9411718ad562ecb85 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 8 + .../azure-resourcemanager-sovereign/README.md | 102 + .../azure-resourcemanager-sovereign/SAMPLE.md | 828 ++++++ .../azure-resourcemanager-sovereign/pom.xml | 63 + .../sovereign/SovereignManager.java | 327 +++ .../LandingZoneAccountOperationsClient.java | 278 ++ ...dingZoneConfigurationOperationsClient.java | 521 ++++ ...ndingZoneRegistrationOperationsClient.java | 275 ++ .../sovereign/fluent/MicrosoftSovereign.java | 76 + .../sovereign/fluent/OperationsClient.java | 40 + ...ingZoneConfigurationCopyResponseInner.java | 106 + .../GenerateLandingZoneResponseInner.java | 296 +++ .../LandingZoneAccountResourceInner.java | 227 ++ ...LandingZoneConfigurationResourceInner.java | 168 ++ .../LandingZoneRegistrationResourceInner.java | 168 ++ .../fluent/models/OperationInner.java | 172 ++ .../UpdateAuthoringStatusResponseInner.java | 139 + .../sovereign/fluent/models/package-info.java | 9 + .../sovereign/fluent/package-info.java | 9 + ...dingZoneConfigurationCopyResponseImpl.java | 33 + .../GenerateLandingZoneResponseImpl.java | 56 + ...andingZoneAccountOperationsClientImpl.java | 1312 +++++++++ .../LandingZoneAccountOperationsImpl.java | 153 ++ .../LandingZoneAccountResourceImpl.java | 202 ++ ...ZoneConfigurationOperationsClientImpl.java | 2352 +++++++++++++++++ ...andingZoneConfigurationOperationsImpl.java | 265 ++ .../LandingZoneConfigurationResourceImpl.java | 187 ++ ...gZoneRegistrationOperationsClientImpl.java | 1370 ++++++++++ ...LandingZoneRegistrationOperationsImpl.java | 183 ++ .../LandingZoneRegistrationResourceImpl.java | 147 ++ .../MicrosoftSovereignBuilder.java | 138 + .../MicrosoftSovereignImpl.java | 336 +++ .../implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 235 ++ .../implementation/OperationsImpl.java | 45 + .../implementation/ResourceManagerUtils.java | 195 ++ .../UpdateAuthoringStatusResponseImpl.java | 37 + .../implementation/package-info.java | 9 + .../sovereign/models/ActionType.java | 46 + .../sovereign/models/AuthoringStatus.java | 56 + ...mmonTypesManagedServiceIdentityUpdate.java | 139 + ...nagerCommonTypesTrackedResourceUpdate.java | 179 ++ ...teLandingZoneConfigurationCopyRequest.java | 104 + ...eLandingZoneConfigurationCopyResponse.java | 27 + .../models/CustomNamingConvention.java | 134 + ...commissionedManagementGroupProperties.java | 145 + ...sionedManagementGroupPropertiesUpdate.java | 138 + .../models/FirewallCreationOptions.java | 56 + .../models/GenerateLandingZoneRequest.java | 462 ++++ .../models/GenerateLandingZoneResponse.java | 68 + .../InfrastructureAsCodeOutputOptions.java | 51 + .../models/LandingZoneAccountOperations.java | 162 ++ .../models/LandingZoneAccountResource.java | 299 +++ .../LandingZoneAccountResourceListResult.java | 138 + .../LandingZoneAccountResourceProperties.java | 125 + ...ngZoneAccountResourcePropertiesUpdate.java | 97 + .../LandingZoneAccountResourceUpdate.java | 216 ++ .../LandingZoneConfigurationOperations.java | 268 ++ .../LandingZoneConfigurationResource.java | 259 ++ ...ngZoneConfigurationResourceListResult.java | 138 + ...ngZoneConfigurationResourceProperties.java | 1017 +++++++ ...ConfigurationResourcePropertiesUpdate.java | 953 +++++++ ...andingZoneConfigurationResourceUpdate.java | 168 ++ .../LandingZoneManagementGroupProperties.java | 147 ++ .../LandingZoneRegistrationOperations.java | 177 ++ .../LandingZoneRegistrationResource.java | 189 ++ ...ingZoneRegistrationResourceListResult.java | 138 + ...ingZoneRegistrationResourceProperties.java | 196 ++ ...eRegistrationResourcePropertiesUpdate.java | 161 ++ ...LandingZoneRegistrationResourceUpdate.java | 168 ++ .../models/ManagedIdentityProperties.java | 130 + .../ManagedIdentityPropertiesUpdate.java | 123 + .../models/ManagedIdentityResourceType.java | 51 + .../models/ManagedServiceIdentity.java | 190 ++ .../models/ManagedServiceIdentityType.java | 62 + .../models/ManagementGroupProperties.java | 112 + .../ManagementGroupPropertiesUpdate.java | 105 + .../sovereign/models/Operation.java | 58 + .../sovereign/models/OperationDisplay.java | 136 + .../sovereign/models/OperationListResult.java | 104 + .../sovereign/models/Operations.java | 35 + .../sovereign/models/Origin.java | 57 + .../PlatformManagementGroupProperties.java | 146 + .../PolicyInitiativeAssignmentProperties.java | 140 + .../sovereign/models/ProvisioningState.java | 71 + .../models/ResourceCreationOptions.java | 56 + .../sovereign/models/ResourceType.java | 91 + .../SandboxManagementGroupProperties.java | 144 + ...andboxManagementGroupPropertiesUpdate.java | 138 + .../sovereign/models/Tags.java | 128 + .../models/UpdateAuthoringStatusRequest.java | 106 + .../models/UpdateAuthoringStatusResponse.java | 33 + .../models/UserAssignedIdentities.java | 102 + .../models/UserAssignedIdentity.java | 122 + .../sovereign/models/package-info.java | 9 + .../sovereign/package-info.java | 9 + .../src/main/java/module-info.java | 15 + .../proxy-config.json | 1 + .../reflect-config.json | 1 + ...ingZoneAccountOperationsCreateSamples.java | 51 + ...ingZoneAccountOperationsDeleteSamples.java | 26 + ...ntOperationsGetByResourceGroupSamples.java | 25 + ...tOperationsListByResourceGroupSamples.java | 26 + ...ndingZoneAccountOperationsListSamples.java | 25 + ...ingZoneAccountOperationsUpdateSamples.java | 38 + ...figurationOperationsCreateCopySamples.java | 30 + ...eConfigurationOperationsCreateSamples.java | 106 + ...eConfigurationOperationsDeleteSamples.java | 26 + ...nOperationsGenerateLandingZoneSamples.java | 41 + ...ZoneConfigurationOperationsGetSamples.java | 26 + ...nOperationsListByResourceGroupSamples.java | 26 + ...onOperationsListBySubscriptionSamples.java | 25 + ...perationsUpdateAuthoringStatusSamples.java | 31 + ...eConfigurationOperationsUpdateSamples.java | 106 + ...neRegistrationOperationsCreateSamples.java | 38 + ...neRegistrationOperationsDeleteSamples.java | 26 + ...gZoneRegistrationOperationsGetSamples.java | 26 + ...nOperationsListByResourceGroupSamples.java | 26 + ...onOperationsListBySubscriptionSamples.java | 25 + ...neRegistrationOperationsUpdateSamples.java | 40 + .../generated/OperationsListSamples.java | 25 + sdk/sovereign/ci.yml | 46 + sdk/sovereign/pom.xml | 15 + 125 files changed, 21090 insertions(+) create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/CHANGELOG.md create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/README.md create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/SAMPLE.md create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/pom.xml create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/SovereignManager.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneAccountOperationsClient.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneConfigurationOperationsClient.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneRegistrationOperationsClient.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/MicrosoftSovereign.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/OperationsClient.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/CreateLandingZoneConfigurationCopyResponseInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/GenerateLandingZoneResponseInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneAccountResourceInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneConfigurationResourceInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneRegistrationResourceInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/OperationInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/UpdateAuthoringStatusResponseInner.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/package-info.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/package-info.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/CreateLandingZoneConfigurationCopyResponseImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/GenerateLandingZoneResponseImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsClientImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountResourceImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsClientImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationResourceImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsClientImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationResourceImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignBuilder.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsClientImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/ResourceManagerUtils.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/UpdateAuthoringStatusResponseImpl.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/package-info.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ActionType.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AuthoringStatus.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyRequest.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyResponse.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CustomNamingConvention.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupPropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/FirewallCreationOptions.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneRequest.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneResponse.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/InfrastructureAsCodeOutputOptions.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountOperations.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResource.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceListResult.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourcePropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationOperations.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResource.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceListResult.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourcePropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneManagementGroupProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationOperations.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResource.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceListResult.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourcePropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityPropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityResourceType.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentity.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentityType.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupPropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operation.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationDisplay.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationListResult.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operations.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Origin.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PlatformManagementGroupProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PolicyInitiativeAssignmentProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ProvisioningState.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceCreationOptions.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceType.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupProperties.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupPropertiesUpdate.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Tags.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusRequest.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusResponse.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentities.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentity.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/package-info.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/package-info.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/module-info.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/proxy-config.json create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/reflect-config.json create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsCreateSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsDeleteSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsGetByResourceGroupSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListByResourceGroupSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsUpdateSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateCopySamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsDeleteSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGenerateLandingZoneSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGetSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListByResourceGroupSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListBySubscriptionSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateAuthoringStatusSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsCreateSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsDeleteSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsGetSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListByResourceGroupSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListBySubscriptionSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsUpdateSamples.java create mode 100644 sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/OperationsListSamples.java create mode 100644 sdk/sovereign/ci.yml create mode 100644 sdk/sovereign/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 32fa74d56d7b..da68a1127afd 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -473,6 +473,7 @@ com.azure.resourcemanager:azure-resourcemanager-terraform;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-connectedcache;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-neonpostgres;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-pineconevectordb;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-sovereign;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 io.clientcore:clientcore-parent;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index f5498ce9b286..25d30bd27de9 100644 --- a/pom.xml +++ b/pom.xml @@ -202,6 +202,7 @@ sdk/servicelinker sdk/servicenetworking sdk/signalr + sdk/sovereign sdk/sphere sdk/spring sdk/spring-experimental diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/CHANGELOG.md b/sdk/sovereign/azure-resourcemanager-sovereign/CHANGELOG.md new file mode 100644 index 000000000000..113c975b6aa2 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2025-02-12) + +- Azure Resource Manager sovereign client library for Java. This package contains Microsoft Azure SDK for sovereign Management SDK. Package tag package-2025-02-27-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-sovereign Java SDK. diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/README.md b/sdk/sovereign/azure-resourcemanager-sovereign/README.md new file mode 100644 index 000000000000..9487fa4c3a4d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager sovereign client library for Java + +Azure Resource Manager sovereign client library for Java. + +This package contains Microsoft Azure SDK for sovereign Management SDK. Package tag package-2025-02-27-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-sovereign;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-sovereign + 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] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +SovereignManager manager = SovereignManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` 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/sovereign/azure-resourcemanager-sovereign/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[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 +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/SAMPLE.md b/sdk/sovereign/azure-resourcemanager-sovereign/SAMPLE.md new file mode 100644 index 000000000000..34ca14ea0543 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/SAMPLE.md @@ -0,0 +1,828 @@ +# Code snippets and samples + + +## LandingZoneAccountOperations + +- [Create](#landingzoneaccountoperations_create) +- [Delete](#landingzoneaccountoperations_delete) +- [GetByResourceGroup](#landingzoneaccountoperations_getbyresourcegroup) +- [List](#landingzoneaccountoperations_list) +- [ListByResourceGroup](#landingzoneaccountoperations_listbyresourcegroup) +- [Update](#landingzoneaccountoperations_update) + +## LandingZoneConfigurationOperations + +- [Create](#landingzoneconfigurationoperations_create) +- [CreateCopy](#landingzoneconfigurationoperations_createcopy) +- [Delete](#landingzoneconfigurationoperations_delete) +- [GenerateLandingZone](#landingzoneconfigurationoperations_generatelandingzone) +- [Get](#landingzoneconfigurationoperations_get) +- [ListByResourceGroup](#landingzoneconfigurationoperations_listbyresourcegroup) +- [ListBySubscription](#landingzoneconfigurationoperations_listbysubscription) +- [Update](#landingzoneconfigurationoperations_update) +- [UpdateAuthoringStatus](#landingzoneconfigurationoperations_updateauthoringstatus) + +## LandingZoneRegistrationOperations + +- [Create](#landingzoneregistrationoperations_create) +- [Delete](#landingzoneregistrationoperations_delete) +- [Get](#landingzoneregistrationoperations_get) +- [ListByResourceGroup](#landingzoneregistrationoperations_listbyresourcegroup) +- [ListBySubscription](#landingzoneregistrationoperations_listbysubscription) +- [Update](#landingzoneregistrationoperations_update) + +## Operations + +- [List](#operations_list) +### LandingZoneAccountOperations_Create + +```java +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceProperties; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentity; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LandingZoneAccountOperations Create. + */ +public final class LandingZoneAccountOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Create.json + */ + /** + * Sample code: LandingZoneAccountOperations_Create. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsCreate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .define("ExampleLZA") + .withRegion("northeurope") + .withExistingResourceGroup("SampleResourceGroup") + .withTags(mapOf("tag1", "MCFS")) + .withProperties(new LandingZoneAccountResourceProperties().withStorageAccount( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestStorageAccount/providers/Microsoft.Storage/storageAccounts/teststorageaccount")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LandingZoneAccountOperations_Delete + +```java +/** + * Samples for LandingZoneAccountOperations Delete. + */ +public final class LandingZoneAccountOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Delete.json + */ + /** + * Sample code: LandingZoneAccountOperations_Delete. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsDelete(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .delete("SampleResourceGroup", "SampleLZA", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneAccountOperations_GetByResourceGroup + +```java +/** + * Samples for LandingZoneAccountOperations GetByResourceGroup. + */ +public final class LandingZoneAccountOperationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Get.json + */ + /** + * Sample code: LandingZoneAccountOperations_Get. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneAccountOperationsGet(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .getByResourceGroupWithResponse("SampleResourceGroup", "SampleLZA", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneAccountOperations_List + +```java +/** + * Samples for LandingZoneAccountOperations List. + */ +public final class LandingZoneAccountOperationsListSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_ListBySubscription.json + */ + /** + * Sample code: LandingZoneAccountOperations_ListBySubscription. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsListBySubscription(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneAccountOperations_ListByResourceGroup + +```java +/** + * Samples for LandingZoneAccountOperations ListByResourceGroup. + */ +public final class LandingZoneAccountOperationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_ListByResourceGroup.json + */ + /** + * Sample code: LandingZoneAccountOperations_ListByResourceGroup_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneAccountOperationsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .listByResourceGroup("SampleResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneAccountOperations_Update + +```java +import com.azure.resourcemanager.sovereign.models.AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentityType; + +/** + * Samples for LandingZoneAccountOperations Update. + */ +public final class LandingZoneAccountOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Update.json + */ + /** + * Sample code: LandingZoneAccountOperations_Update. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsUpdate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + LandingZoneAccountResource resource = manager.landingZoneAccountOperations() + .getByResourceGroupWithResponse("ExampleResourceGroup", "ExampleLZA", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new LandingZoneAccountResourcePropertiesUpdate().withStorageAccount( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/TestStorageAccount/providers/Microsoft.Storage/storageAccounts/teststcontainer")) + .withIdentity(new AzureResourceManagerCommonTypesManagedServiceIdentityUpdate() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } +} +``` + +### LandingZoneConfigurationOperations_Create + +```java +import com.azure.resourcemanager.sovereign.models.CustomNamingConvention; +import com.azure.resourcemanager.sovereign.models.DecommissionedManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.FirewallCreationOptions; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceProperties; +import com.azure.resourcemanager.sovereign.models.LandingZoneManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; +import com.azure.resourcemanager.sovereign.models.ManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.PlatformManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.PolicyInitiativeAssignmentProperties; +import com.azure.resourcemanager.sovereign.models.ResourceCreationOptions; +import com.azure.resourcemanager.sovereign.models.ResourceType; +import com.azure.resourcemanager.sovereign.models.SandboxManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.Tags; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LandingZoneConfigurationOperations Create. + */ +public final class LandingZoneConfigurationOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Create.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Create. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsCreate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .define("ExampleLZC") + .withExistingLandingZoneAccount("ExampleResourceGroup", "ExampleLZA") + .withProperties(new LandingZoneConfigurationResourceProperties() + .withDdosProtectionCreationOption(ResourceCreationOptions.YES) + .withLogAnalyticsWorkspaceCreationOption(ResourceCreationOptions.NO) + .withTags(Arrays.asList(new Tags().withName("tag1").withValue("do"), + new Tags().withName("tag2").withValue("do"))) + .withFirewallCreationOption(FirewallCreationOptions.STANDARD) + .withFirewallSubnetCidrBlock("10.20.255.0/24") + .withGatewaySubnetCidrBlock("10.20.255.0/24") + .withLogRetentionInDays(540L) + .withHubNetworkCidrBlock("10.20.255.0/24") + .withAzureBastionCreationOption(ResourceCreationOptions.YES) + .withAzureBastionSubnetCidrBlock("10.20.255.0/24") + .withLandingZonesMgChildren(Arrays.asList(new LandingZoneManagementGroupProperties() + .withPolicyInitiativesAssignmentProperties(Arrays.asList(new PolicyInitiativeAssignmentProperties() + .withPolicyInitiativeId("c138fd1a-e08f-4318-9490-d11ef2c2f9c1") + .withAssignmentParameters(mapOf()))) + .withName("Corp"))) + .withTopLevelMgMetadata(new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties( + Arrays.asList(new PolicyInitiativeAssignmentProperties().withPolicyInitiativeId( + "/providers/Microsoft.Authorization/policySetDefinitions/0a2ebd47-3fb9-4735-a006-b7f31ddadd9f") + .withAssignmentParameters(mapOf("Effect", "Audit"))))) + .withLandingZonesMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformManagementMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformConnectivityMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformIdentityMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withDecommissionedMgMetadata(new DecommissionedManagementGroupProperties() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(false)) + .withSandboxMgMetadata( + new SandboxManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(true)) + .withManagedIdentity( + new ManagedIdentityProperties().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED)) + .withPlatformMgChildren(Arrays.asList( + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg1"), + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg2"))) + .withNamingConventionFormula("{ResourceTypeAbbreviation}") + .withCustomNamingConvention( + Arrays.asList(new CustomNamingConvention().withResourceType(ResourceType.AZURE_FIREWALLS) + .withFormula("{DeploymentSuffix}")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LandingZoneConfigurationOperations_CreateCopy + +```java +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyRequest; + +/** + * Samples for LandingZoneConfigurationOperations CreateCopy. + */ +public final class LandingZoneConfigurationOperationsCreateCopySamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_CreateCopy.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_CreateCopy. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsCreateCopy(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .createCopy("ExampleResourceGroup", "SampleLZA", "ExampleLZC", + new CreateLandingZoneConfigurationCopyRequest().withName("LandingZoneConfiguration"), + com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneConfigurationOperations_Delete + +```java +/** + * Samples for LandingZoneConfigurationOperations Delete. + */ +public final class LandingZoneConfigurationOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Delete.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Delete. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsDelete(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .delete("ExampleResourceGroup", "SampleLZA", "ExampleLZC", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneConfigurationOperations_GenerateLandingZone + +```java +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneRequest; +import com.azure.resourcemanager.sovereign.models.InfrastructureAsCodeOutputOptions; + +/** + * Samples for LandingZoneConfigurationOperations GenerateLandingZone. + */ +public final class LandingZoneConfigurationOperationsGenerateLandingZoneSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_GenerateLandingZone.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_GenerateLandingZone. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsGenerateLandingZone( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .generateLandingZone("ExampleResourceGroup", "SampleLZA", "ExampleLZC", + new GenerateLandingZoneRequest() + .withInfrastructureAsCodeOutputOptions(InfrastructureAsCodeOutputOptions.BICEP) + .withExistingManagementSubscriptionId("/subscriptions/00000000-0000-0000-0000-000000000001") + .withExistingIdentitySubscriptionId("/subscriptions/00000000-0000-0000-0000-000000000002") + .withExistingConnectivitySubscriptionId("/subscriptions/00000000-0000-0000-0000-000000000003") + .withDeploymentPrefix("mcfs") + .withDeploymentSuffix("test") + .withTopLevelMgDisplayName("TestMG") + .withDeploymentLocation("eastus") + .withOrganization("test") + .withEnvironment("QA"), + com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneConfigurationOperations_Get + +```java +/** + * Samples for LandingZoneConfigurationOperations Get. + */ +public final class LandingZoneConfigurationOperationsGetSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Get.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Get. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsGet(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .getWithResponse("rgsovereign", "SampleLZA", "SampleLZC", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneConfigurationOperations_ListByResourceGroup + +```java +/** + * Samples for LandingZoneConfigurationOperations ListByResourceGroup. + */ +public final class LandingZoneConfigurationOperationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_ListByResourceGroup.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_ListByResourceGroup. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsListByResourceGroup( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .listByResourceGroup("ExampleResourceGroup", "ExampleLZA", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneConfigurationOperations_ListBySubscription + +```java +/** + * Samples for LandingZoneConfigurationOperations ListBySubscription. + */ +public final class LandingZoneConfigurationOperationsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_ListBySubscription.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_ListBySubscription. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsListBySubscription( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations().listBySubscription("ExampleLZA", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneConfigurationOperations_Update + +```java +import com.azure.resourcemanager.sovereign.models.CustomNamingConvention; +import com.azure.resourcemanager.sovereign.models.DecommissionedManagementGroupPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.FirewallCreationOptions; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; +import com.azure.resourcemanager.sovereign.models.ManagementGroupPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.PlatformManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.PolicyInitiativeAssignmentProperties; +import com.azure.resourcemanager.sovereign.models.ResourceCreationOptions; +import com.azure.resourcemanager.sovereign.models.ResourceType; +import com.azure.resourcemanager.sovereign.models.SandboxManagementGroupPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.Tags; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LandingZoneConfigurationOperations Update. + */ +public final class LandingZoneConfigurationOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Update.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Update. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsUpdate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + LandingZoneConfigurationResource resource = manager.landingZoneConfigurationOperations() + .getWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZC", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new LandingZoneConfigurationResourcePropertiesUpdate() + .withDdosProtectionCreationOption(ResourceCreationOptions.YES) + .withLogAnalyticsWorkspaceCreationOption(ResourceCreationOptions.NO) + .withTags(Arrays.asList(new Tags().withName("tag1").withValue("do"), + new Tags().withName("tag2").withValue("do"))) + .withFirewallCreationOption(FirewallCreationOptions.STANDARD) + .withFirewallSubnetCidrBlock("10.20.255.0/24") + .withGatewaySubnetCidrBlock("10.20.255.0/24") + .withLogRetentionInDays(540L) + .withHubNetworkCidrBlock("10.20.255.0/24") + .withAzureBastionCreationOption(ResourceCreationOptions.YES) + .withAzureBastionSubnetCidrBlock("10.20.255.0/24") + .withLandingZonesMgChildren(Arrays.asList(new LandingZoneManagementGroupProperties() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("Corp"))) + .withTopLevelMgMetadata(new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties( + Arrays.asList(new PolicyInitiativeAssignmentProperties().withPolicyInitiativeId( + "/providers/Microsoft.Authorization/policySetDefinitions/0a2ebd47-3fb9-4735-a006-b7f31ddadd9f") + .withAssignmentParameters(mapOf("Effect", "Audit"))))) + .withLandingZonesMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformManagementMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformConnectivityMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformIdentityMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withDecommissionedMgMetadata(new DecommissionedManagementGroupPropertiesUpdate() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(false)) + .withSandboxMgMetadata(new SandboxManagementGroupPropertiesUpdate() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(true)) + .withManagedIdentity( + new ManagedIdentityPropertiesUpdate().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED)) + .withPlatformMgChildren(Arrays.asList( + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg1"), + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg2"))) + .withNamingConventionFormula("{ResourceTypeAbbreviation}") + .withCustomNamingConvention( + Arrays.asList(new CustomNamingConvention().withResourceType(ResourceType.AZURE_FIREWALLS) + .withFormula("{DeploymentSuffix}")))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### LandingZoneConfigurationOperations_UpdateAuthoringStatus + +```java +import com.azure.resourcemanager.sovereign.models.AuthoringStatus; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusRequest; + +/** + * Samples for LandingZoneConfigurationOperations UpdateAuthoringStatus. + */ +public final class LandingZoneConfigurationOperationsUpdateAuthoringStatusSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_UpdateAuthoringStatus.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_UpdateAuthoringStatus. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsUpdateAuthoringStatus( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .updateAuthoringStatus("ExampleResourceGroup", "ExampleLZA", "ExampleLZC", + new UpdateAuthoringStatusRequest().withAuthoringStatus(AuthoringStatus.AUTHORING), + com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneRegistrationOperations_Create + +```java +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; + +/** + * Samples for LandingZoneRegistrationOperations Create. + */ +public final class LandingZoneRegistrationOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Create.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Create. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsCreate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .define("ExampleLZR") + .withExistingLandingZoneAccount("ExampleResourceGroup", "ExampleLZA") + .withProperties(new LandingZoneRegistrationResourceProperties() + .withExistingTopLevelMgId("/providers/Microsoft.Management/managementGroups/mcfs") + .withExistingLandingZoneConfigurationId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/TestResourceGroup/providers/Microsoft.Sovereign/landingZoneAccounts/ExampleLZA/landingZoneConfigurations/ExampleLZC") + .withManagedIdentity( + new ManagedIdentityProperties().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED))) + .create(); + } +} +``` + +### LandingZoneRegistrationOperations_Delete + +```java +/** + * Samples for LandingZoneRegistrationOperations Delete. + */ +public final class LandingZoneRegistrationOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Delete.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Delete. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsDelete(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .deleteWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZR", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneRegistrationOperations_Get + +```java +/** + * Samples for LandingZoneRegistrationOperations Get. + */ +public final class LandingZoneRegistrationOperationsGetSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Get.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Get. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsGet(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .getWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZR", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneRegistrationOperations_ListByResourceGroup + +```java +/** + * Samples for LandingZoneRegistrationOperations ListByResourceGroup. + */ +public final class LandingZoneRegistrationOperationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_ListByResourceGroup.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_ListByResourceGroup. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneRegistrationOperationsListByResourceGroup( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .listByResourceGroup("ExampleResourceGroup", "ExampleLZA", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneRegistrationOperations_ListBySubscription + +```java +/** + * Samples for LandingZoneRegistrationOperations ListBySubscription. + */ +public final class LandingZoneRegistrationOperationsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_ListBySubscription.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_ListBySubscription. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneRegistrationOperationsListBySubscription( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations().listBySubscription("ExampleLZA", com.azure.core.util.Context.NONE); + } +} +``` + +### LandingZoneRegistrationOperations_Update + +```java +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; + +/** + * Samples for LandingZoneRegistrationOperations Update. + */ +public final class LandingZoneRegistrationOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Update.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Update. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsUpdate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + LandingZoneRegistrationResource resource = manager.landingZoneRegistrationOperations() + .getWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZR", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new LandingZoneRegistrationResourcePropertiesUpdate() + .withExistingTopLevelMgId("/providers/Microsoft.Management/managementGroups/mcfs") + .withExistingLandingZoneConfigurationId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/TestResourceGroup/providers/Microsoft.Sovereign/landingZoneAccounts/ExampleLZA/landingZoneConfigurations/ExampleLZC") + .withManagedIdentity( + new ManagedIdentityPropertiesUpdate().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED))) + .apply(); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/Operations_List. + * json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to SovereignManager. + */ + public static void operationsListMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/pom.xml b/sdk/sovereign/azure-resourcemanager-sovereign/pom.xml new file mode 100644 index 000000000000..f7ef82237c2f --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-sovereign + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for sovereign Management + This package contains Microsoft Azure SDK for sovereign Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2025-02-27-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + false + + + + com.azure + azure-core + 1.55.0 + + + com.azure + azure-core-management + 1.16.0 + + + diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/SovereignManager.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/SovereignManager.java new file mode 100644 index 000000000000..a53bbf60119d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/SovereignManager.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign; + +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.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +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.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.sovereign.fluent.MicrosoftSovereign; +import com.azure.resourcemanager.sovereign.implementation.LandingZoneAccountOperationsImpl; +import com.azure.resourcemanager.sovereign.implementation.LandingZoneConfigurationOperationsImpl; +import com.azure.resourcemanager.sovereign.implementation.LandingZoneRegistrationOperationsImpl; +import com.azure.resourcemanager.sovereign.implementation.MicrosoftSovereignBuilder; +import com.azure.resourcemanager.sovereign.implementation.OperationsImpl; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountOperations; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationOperations; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationOperations; +import com.azure.resourcemanager.sovereign.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 SovereignManager. + */ +public final class SovereignManager { + private Operations operations; + + private LandingZoneAccountOperations landingZoneAccountOperations; + + private LandingZoneConfigurationOperations landingZoneConfigurationOperations; + + private LandingZoneRegistrationOperations landingZoneRegistrationOperations; + + private final MicrosoftSovereign clientObject; + + private SovereignManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new MicrosoftSovereignBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of sovereign service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the sovereign service API instance. + */ + public static SovereignManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of sovereign service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the sovereign service API instance. + */ + public static SovereignManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new SovereignManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create SovereignManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new SovereignManager.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 RetryOptions retryOptions; + 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 retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' 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 sovereign service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the sovereign service API instance. + */ + public SovereignManager 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.sovereign") + .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) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + 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 BearerTokenAuthenticationPolicy(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 SovereignManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of LandingZoneAccountOperations. It manages LandingZoneAccountResource. + * + * @return Resource collection API of LandingZoneAccountOperations. + */ + public LandingZoneAccountOperations landingZoneAccountOperations() { + if (this.landingZoneAccountOperations == null) { + this.landingZoneAccountOperations + = new LandingZoneAccountOperationsImpl(clientObject.getLandingZoneAccountOperations(), this); + } + return landingZoneAccountOperations; + } + + /** + * Gets the resource collection API of LandingZoneConfigurationOperations. It manages + * LandingZoneConfigurationResource. + * + * @return Resource collection API of LandingZoneConfigurationOperations. + */ + public LandingZoneConfigurationOperations landingZoneConfigurationOperations() { + if (this.landingZoneConfigurationOperations == null) { + this.landingZoneConfigurationOperations = new LandingZoneConfigurationOperationsImpl( + clientObject.getLandingZoneConfigurationOperations(), this); + } + return landingZoneConfigurationOperations; + } + + /** + * Gets the resource collection API of LandingZoneRegistrationOperations. It manages + * LandingZoneRegistrationResource. + * + * @return Resource collection API of LandingZoneRegistrationOperations. + */ + public LandingZoneRegistrationOperations landingZoneRegistrationOperations() { + if (this.landingZoneRegistrationOperations == null) { + this.landingZoneRegistrationOperations + = new LandingZoneRegistrationOperationsImpl(clientObject.getLandingZoneRegistrationOperations(), this); + } + return landingZoneRegistrationOperations; + } + + /** + * Gets wrapped service client MicrosoftSovereign providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client MicrosoftSovereign. + */ + public MicrosoftSovereign serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneAccountOperationsClient.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneAccountOperationsClient.java new file mode 100644 index 000000000000..60099082dcd9 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneAccountOperationsClient.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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.sovereign.fluent.models.LandingZoneAccountResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceUpdate; + +/** + * An instance of this class provides access to all the operations defined in LandingZoneAccountOperationsClient. + */ +public interface LandingZoneAccountOperationsClient { + /** + * List the landing zone accounts within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the landing zone accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String landingZoneAccountName, Context context); + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneAccountResourceInner getByResourceGroup(String resourceGroupName, String landingZoneAccountName); + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneAccountResourceInner> + beginCreate(String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceInner resource); + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneAccountResourceInner> beginCreate( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceInner resource, + Context context); + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneAccountResourceInner create(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceInner resource); + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneAccountResourceInner create(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceInner resource, Context context); + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneAccountResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceUpdate properties); + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneAccountResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceUpdate properties, + Context context); + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneAccountResourceInner update(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceUpdate properties); + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneAccountResourceInner update(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceUpdate properties, Context context); + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 landingZoneAccountName); + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String landingZoneAccountName, + Context context); + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String landingZoneAccountName); + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String landingZoneAccountName, Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneConfigurationOperationsClient.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneConfigurationOperationsClient.java new file mode 100644 index 000000000000..51bc0445efae --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneConfigurationOperationsClient.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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.sovereign.fluent.models.CreateLandingZoneConfigurationCopyResponseInner; +import com.azure.resourcemanager.sovereign.fluent.models.GenerateLandingZoneResponseInner; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner; +import com.azure.resourcemanager.sovereign.fluent.models.UpdateAuthoringStatusResponseInner; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyRequest; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneRequest; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceUpdate; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusRequest; + +/** + * An instance of this class provides access to all the operations defined in LandingZoneConfigurationOperationsClient. + */ +public interface LandingZoneConfigurationOperationsClient { + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(String landingZoneAccountName); + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(String landingZoneAccountName, + Context context); + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName); + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context); + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, Context context); + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneConfigurationResourceInner get(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName); + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneConfigurationResourceInner> beginCreate( + String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource); + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneConfigurationResourceInner> beginCreate( + String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource, Context context); + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneConfigurationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceInner resource); + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneConfigurationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceInner resource, Context context); + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneConfigurationResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties); + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneConfigurationResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties, Context context); + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneConfigurationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceUpdate properties); + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneConfigurationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceUpdate properties, Context context); + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName); + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, Context context); + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName); + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + Context context); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CreateLandingZoneConfigurationCopyResponseInner> + beginCreateCopy(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CreateLandingZoneConfigurationCopyResponseInner> + beginCreateCopy(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body, Context context); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CreateLandingZoneConfigurationCopyResponseInner createCopy(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, CreateLandingZoneConfigurationCopyRequest body); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CreateLandingZoneConfigurationCopyResponseInner createCopy(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, CreateLandingZoneConfigurationCopyRequest body, Context context); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response payload for generating infrastructure-as-code for the + * landing zone. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenerateLandingZoneResponseInner> beginGenerateLandingZone( + String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + GenerateLandingZoneRequest body); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response payload for generating infrastructure-as-code for the + * landing zone. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenerateLandingZoneResponseInner> beginGenerateLandingZone( + String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + GenerateLandingZoneRequest body, Context context); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateLandingZoneResponseInner generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenerateLandingZoneResponseInner generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body, Context context); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UpdateAuthoringStatusResponseInner> + beginUpdateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, UpdateAuthoringStatusResponseInner> + beginUpdateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, Context context); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateAuthoringStatusResponseInner updateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + UpdateAuthoringStatusResponseInner updateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneRegistrationOperationsClient.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneRegistrationOperationsClient.java new file mode 100644 index 000000000000..524f039c5c45 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/LandingZoneRegistrationOperationsClient.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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.sovereign.fluent.models.LandingZoneRegistrationResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceUpdate; + +/** + * An instance of this class provides access to all the operations defined in LandingZoneRegistrationOperationsClient. + */ +public interface LandingZoneRegistrationOperationsClient { + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(String landingZoneAccountName); + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(String landingZoneAccountName, + Context context); + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName); + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context); + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, Context context); + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneRegistrationResourceInner get(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName); + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneRegistrationResourceInner> beginCreate( + String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource); + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneRegistrationResourceInner> beginCreate( + String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource, Context context); + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneRegistrationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceInner resource); + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneRegistrationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceInner resource, Context context); + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneRegistrationResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties); + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, LandingZoneRegistrationResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties, Context context); + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneRegistrationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceUpdate properties); + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LandingZoneRegistrationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceUpdate properties, Context context); + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, Context context); + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/MicrosoftSovereign.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/MicrosoftSovereign.java new file mode 100644 index 000000000000..69295c282e17 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/MicrosoftSovereign.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for MicrosoftSovereign class. + */ +public interface MicrosoftSovereign { + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @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 OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the LandingZoneAccountOperationsClient object to access its operations. + * + * @return the LandingZoneAccountOperationsClient object. + */ + LandingZoneAccountOperationsClient getLandingZoneAccountOperations(); + + /** + * Gets the LandingZoneConfigurationOperationsClient object to access its operations. + * + * @return the LandingZoneConfigurationOperationsClient object. + */ + LandingZoneConfigurationOperationsClient getLandingZoneConfigurationOperations(); + + /** + * Gets the LandingZoneRegistrationOperationsClient object to access its operations. + * + * @return the LandingZoneRegistrationOperationsClient object. + */ + LandingZoneRegistrationOperationsClient getLandingZoneRegistrationOperations(); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/OperationsClient.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/OperationsClient.java new file mode 100644 index 000000000000..02ded4044d7a --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/OperationsClient.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.sovereign.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.sovereign.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/CreateLandingZoneConfigurationCopyResponseInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/CreateLandingZoneConfigurationCopyResponseInner.java new file mode 100644 index 000000000000..273f327a01e4 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/CreateLandingZoneConfigurationCopyResponseInner.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.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The response of the create duplicate landing zone configuration. + */ +@Fluent +public final class CreateLandingZoneConfigurationCopyResponseInner + implements JsonSerializable { + /* + * The ID of the duplicate landing zone configuration resource. + */ + private String copiedLandingZoneConfigurationId; + + /** + * Creates an instance of CreateLandingZoneConfigurationCopyResponseInner class. + */ + public CreateLandingZoneConfigurationCopyResponseInner() { + } + + /** + * Get the copiedLandingZoneConfigurationId property: The ID of the duplicate landing zone configuration resource. + * + * @return the copiedLandingZoneConfigurationId value. + */ + public String copiedLandingZoneConfigurationId() { + return this.copiedLandingZoneConfigurationId; + } + + /** + * Set the copiedLandingZoneConfigurationId property: The ID of the duplicate landing zone configuration resource. + * + * @param copiedLandingZoneConfigurationId the copiedLandingZoneConfigurationId value to set. + * @return the CreateLandingZoneConfigurationCopyResponseInner object itself. + */ + public CreateLandingZoneConfigurationCopyResponseInner + withCopiedLandingZoneConfigurationId(String copiedLandingZoneConfigurationId) { + this.copiedLandingZoneConfigurationId = copiedLandingZoneConfigurationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (copiedLandingZoneConfigurationId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property copiedLandingZoneConfigurationId in model CreateLandingZoneConfigurationCopyResponseInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateLandingZoneConfigurationCopyResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("copiedLandingZoneConfigurationId", this.copiedLandingZoneConfigurationId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateLandingZoneConfigurationCopyResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateLandingZoneConfigurationCopyResponseInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateLandingZoneConfigurationCopyResponseInner. + */ + public static CreateLandingZoneConfigurationCopyResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateLandingZoneConfigurationCopyResponseInner deserializedCreateLandingZoneConfigurationCopyResponseInner + = new CreateLandingZoneConfigurationCopyResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("copiedLandingZoneConfigurationId".equals(fieldName)) { + deserializedCreateLandingZoneConfigurationCopyResponseInner.copiedLandingZoneConfigurationId + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateLandingZoneConfigurationCopyResponseInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/GenerateLandingZoneResponseInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/GenerateLandingZoneResponseInner.java new file mode 100644 index 000000000000..a10ed1ca46cf --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/GenerateLandingZoneResponseInner.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The response payload for generating infrastructure-as-code for the landing zone. + */ +@Fluent +public final class GenerateLandingZoneResponseInner implements JsonSerializable { + /* + * The parent management group name of the landing zone deployment. + */ + private String topLevelMgDisplayName; + + /* + * The name of the Landing zone configuration resource. + */ + private String landingZoneConfigurationName; + + /* + * The url to access the generated code. + */ + private String generatedCodeUrl; + + /* + * The storage account name to access the generated code. + */ + private String storageAccountName; + + /* + * The storage account container to access the generated code. + */ + private String containerName; + + /* + * The storage account blob name to access the generated code. + */ + private String blobName; + + /* + * The generated code content in JSON string format. + */ + private String generatedArmTemplate; + + /** + * Creates an instance of GenerateLandingZoneResponseInner class. + */ + public GenerateLandingZoneResponseInner() { + } + + /** + * Get the topLevelMgDisplayName property: The parent management group name of the landing zone deployment. + * + * @return the topLevelMgDisplayName value. + */ + public String topLevelMgDisplayName() { + return this.topLevelMgDisplayName; + } + + /** + * Set the topLevelMgDisplayName property: The parent management group name of the landing zone deployment. + * + * @param topLevelMgDisplayName the topLevelMgDisplayName value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withTopLevelMgDisplayName(String topLevelMgDisplayName) { + this.topLevelMgDisplayName = topLevelMgDisplayName; + return this; + } + + /** + * Get the landingZoneConfigurationName property: The name of the Landing zone configuration resource. + * + * @return the landingZoneConfigurationName value. + */ + public String landingZoneConfigurationName() { + return this.landingZoneConfigurationName; + } + + /** + * Set the landingZoneConfigurationName property: The name of the Landing zone configuration resource. + * + * @param landingZoneConfigurationName the landingZoneConfigurationName value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withLandingZoneConfigurationName(String landingZoneConfigurationName) { + this.landingZoneConfigurationName = landingZoneConfigurationName; + return this; + } + + /** + * Get the generatedCodeUrl property: The url to access the generated code. + * + * @return the generatedCodeUrl value. + */ + public String generatedCodeUrl() { + return this.generatedCodeUrl; + } + + /** + * Set the generatedCodeUrl property: The url to access the generated code. + * + * @param generatedCodeUrl the generatedCodeUrl value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withGeneratedCodeUrl(String generatedCodeUrl) { + this.generatedCodeUrl = generatedCodeUrl; + return this; + } + + /** + * Get the storageAccountName property: The storage account name to access the generated code. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The storage account name to access the generated code. + * + * @param storageAccountName the storageAccountName value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the containerName property: The storage account container to access the generated code. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The storage account container to access the generated code. + * + * @param containerName the containerName value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the blobName property: The storage account blob name to access the generated code. + * + * @return the blobName value. + */ + public String blobName() { + return this.blobName; + } + + /** + * Set the blobName property: The storage account blob name to access the generated code. + * + * @param blobName the blobName value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withBlobName(String blobName) { + this.blobName = blobName; + return this; + } + + /** + * Get the generatedArmTemplate property: The generated code content in JSON string format. + * + * @return the generatedArmTemplate value. + */ + public String generatedArmTemplate() { + return this.generatedArmTemplate; + } + + /** + * Set the generatedArmTemplate property: The generated code content in JSON string format. + * + * @param generatedArmTemplate the generatedArmTemplate value to set. + * @return the GenerateLandingZoneResponseInner object itself. + */ + public GenerateLandingZoneResponseInner withGeneratedArmTemplate(String generatedArmTemplate) { + this.generatedArmTemplate = generatedArmTemplate; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (topLevelMgDisplayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property topLevelMgDisplayName in model GenerateLandingZoneResponseInner")); + } + if (landingZoneConfigurationName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property landingZoneConfigurationName in model GenerateLandingZoneResponseInner")); + } + if (generatedCodeUrl() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property generatedCodeUrl in model GenerateLandingZoneResponseInner")); + } + if (storageAccountName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageAccountName in model GenerateLandingZoneResponseInner")); + } + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model GenerateLandingZoneResponseInner")); + } + if (blobName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property blobName in model GenerateLandingZoneResponseInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateLandingZoneResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("topLevelMgDisplayName", this.topLevelMgDisplayName); + jsonWriter.writeStringField("landingZoneConfigurationName", this.landingZoneConfigurationName); + jsonWriter.writeStringField("generatedCodeUrl", this.generatedCodeUrl); + jsonWriter.writeStringField("storageAccountName", this.storageAccountName); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("blobName", this.blobName); + jsonWriter.writeStringField("generatedArmTemplate", this.generatedArmTemplate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateLandingZoneResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateLandingZoneResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateLandingZoneResponseInner. + */ + public static GenerateLandingZoneResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateLandingZoneResponseInner deserializedGenerateLandingZoneResponseInner + = new GenerateLandingZoneResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("topLevelMgDisplayName".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.topLevelMgDisplayName = reader.getString(); + } else if ("landingZoneConfigurationName".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.landingZoneConfigurationName = reader.getString(); + } else if ("generatedCodeUrl".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.generatedCodeUrl = reader.getString(); + } else if ("storageAccountName".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.storageAccountName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.containerName = reader.getString(); + } else if ("blobName".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.blobName = reader.getString(); + } else if ("generatedArmTemplate".equals(fieldName)) { + deserializedGenerateLandingZoneResponseInner.generatedArmTemplate = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateLandingZoneResponseInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneAccountResourceInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneAccountResourceInner.java new file mode 100644 index 000000000000..9ce200dda438 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneAccountResourceInner.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.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceProperties; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * The Landing zone account resource type. A Landing zone account is the container for configuring, deploying and + * managing multiple landing zones. + */ +@Fluent +public final class LandingZoneAccountResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private LandingZoneAccountResourceProperties properties; + + /* + * The managed service identities assigned to this resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LandingZoneAccountResourceInner class. + */ + public LandingZoneAccountResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LandingZoneAccountResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LandingZoneAccountResourceInner object itself. + */ + public LandingZoneAccountResourceInner withProperties(LandingZoneAccountResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the LandingZoneAccountResourceInner object itself. + */ + public LandingZoneAccountResourceInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LandingZoneAccountResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public LandingZoneAccountResourceInner 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(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneAccountResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneAccountResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneAccountResourceInner. + */ + public static LandingZoneAccountResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneAccountResourceInner deserializedLandingZoneAccountResourceInner + = new LandingZoneAccountResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLandingZoneAccountResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.properties + = LandingZoneAccountResourceProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLandingZoneAccountResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneAccountResourceInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneConfigurationResourceInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneConfigurationResourceInner.java new file mode 100644 index 000000000000..5a6eff4c258a --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneConfigurationResourceInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceProperties; +import java.io.IOException; + +/** + * Concrete proxy resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class LandingZoneConfigurationResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private LandingZoneConfigurationResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LandingZoneConfigurationResourceInner class. + */ + public LandingZoneConfigurationResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LandingZoneConfigurationResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LandingZoneConfigurationResourceInner object itself. + */ + public LandingZoneConfigurationResourceInner withProperties(LandingZoneConfigurationResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneConfigurationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneConfigurationResourceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneConfigurationResourceInner. + */ + public static LandingZoneConfigurationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneConfigurationResourceInner deserializedLandingZoneConfigurationResourceInner + = new LandingZoneConfigurationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceInner.properties + = LandingZoneConfigurationResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneConfigurationResourceInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneRegistrationResourceInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneRegistrationResourceInner.java new file mode 100644 index 000000000000..5c4f2406892d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/LandingZoneRegistrationResourceInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceProperties; +import java.io.IOException; + +/** + * The Landing zone registration resource type. + */ +@Fluent +public final class LandingZoneRegistrationResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private LandingZoneRegistrationResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LandingZoneRegistrationResourceInner class. + */ + public LandingZoneRegistrationResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LandingZoneRegistrationResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LandingZoneRegistrationResourceInner object itself. + */ + public LandingZoneRegistrationResourceInner withProperties(LandingZoneRegistrationResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneRegistrationResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneRegistrationResourceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneRegistrationResourceInner. + */ + public static LandingZoneRegistrationResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneRegistrationResourceInner deserializedLandingZoneRegistrationResourceInner + = new LandingZoneRegistrationResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceInner.properties + = LandingZoneRegistrationResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneRegistrationResourceInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/OperationInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/OperationInner.java new file mode 100644 index 000000000000..723f4a490d02 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/OperationInner.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.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.models.ActionType; +import com.azure.resourcemanager.sovereign.models.OperationDisplay; +import com.azure.resourcemanager.sovereign.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/UpdateAuthoringStatusResponseInner.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/UpdateAuthoringStatusResponseInner.java new file mode 100644 index 000000000000..929c77d67262 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/UpdateAuthoringStatusResponseInner.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.models.AuthoringStatus; +import java.io.IOException; + +/** + * The response for authoring status update request. + */ +@Fluent +public final class UpdateAuthoringStatusResponseInner implements JsonSerializable { + /* + * The name of the landing zone configuration resource. + */ + private String landingZoneConfigurationName; + + /* + * The authoring status value to be updated. + */ + private AuthoringStatus authoringStatus; + + /** + * Creates an instance of UpdateAuthoringStatusResponseInner class. + */ + public UpdateAuthoringStatusResponseInner() { + } + + /** + * Get the landingZoneConfigurationName property: The name of the landing zone configuration resource. + * + * @return the landingZoneConfigurationName value. + */ + public String landingZoneConfigurationName() { + return this.landingZoneConfigurationName; + } + + /** + * Set the landingZoneConfigurationName property: The name of the landing zone configuration resource. + * + * @param landingZoneConfigurationName the landingZoneConfigurationName value to set. + * @return the UpdateAuthoringStatusResponseInner object itself. + */ + public UpdateAuthoringStatusResponseInner withLandingZoneConfigurationName(String landingZoneConfigurationName) { + this.landingZoneConfigurationName = landingZoneConfigurationName; + return this; + } + + /** + * Get the authoringStatus property: The authoring status value to be updated. + * + * @return the authoringStatus value. + */ + public AuthoringStatus authoringStatus() { + return this.authoringStatus; + } + + /** + * Set the authoringStatus property: The authoring status value to be updated. + * + * @param authoringStatus the authoringStatus value to set. + * @return the UpdateAuthoringStatusResponseInner object itself. + */ + public UpdateAuthoringStatusResponseInner withAuthoringStatus(AuthoringStatus authoringStatus) { + this.authoringStatus = authoringStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (landingZoneConfigurationName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property landingZoneConfigurationName in model UpdateAuthoringStatusResponseInner")); + } + if (authoringStatus() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authoringStatus in model UpdateAuthoringStatusResponseInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateAuthoringStatusResponseInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("landingZoneConfigurationName", this.landingZoneConfigurationName); + jsonWriter.writeStringField("authoringStatus", + this.authoringStatus == null ? null : this.authoringStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateAuthoringStatusResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateAuthoringStatusResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateAuthoringStatusResponseInner. + */ + public static UpdateAuthoringStatusResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateAuthoringStatusResponseInner deserializedUpdateAuthoringStatusResponseInner + = new UpdateAuthoringStatusResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("landingZoneConfigurationName".equals(fieldName)) { + deserializedUpdateAuthoringStatusResponseInner.landingZoneConfigurationName = reader.getString(); + } else if ("authoringStatus".equals(fieldName)) { + deserializedUpdateAuthoringStatusResponseInner.authoringStatus + = AuthoringStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateAuthoringStatusResponseInner; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/package-info.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/package-info.java new file mode 100644 index 000000000000..a6d0fbf08560 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// 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 MicrosoftSovereign. + * null. + */ +package com.azure.resourcemanager.sovereign.fluent.models; diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/package-info.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/package-info.java new file mode 100644 index 000000000000..54e6924d9485 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/fluent/package-info.java @@ -0,0 +1,9 @@ +// 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 MicrosoftSovereign. + * null. + */ +package com.azure.resourcemanager.sovereign.fluent; diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/CreateLandingZoneConfigurationCopyResponseImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/CreateLandingZoneConfigurationCopyResponseImpl.java new file mode 100644 index 000000000000..7f64265464a2 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/CreateLandingZoneConfigurationCopyResponseImpl.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.sovereign.implementation; + +import com.azure.resourcemanager.sovereign.fluent.models.CreateLandingZoneConfigurationCopyResponseInner; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyResponse; + +public final class CreateLandingZoneConfigurationCopyResponseImpl + implements CreateLandingZoneConfigurationCopyResponse { + private CreateLandingZoneConfigurationCopyResponseInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + CreateLandingZoneConfigurationCopyResponseImpl(CreateLandingZoneConfigurationCopyResponseInner innerObject, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String copiedLandingZoneConfigurationId() { + return this.innerModel().copiedLandingZoneConfigurationId(); + } + + public CreateLandingZoneConfigurationCopyResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/GenerateLandingZoneResponseImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/GenerateLandingZoneResponseImpl.java new file mode 100644 index 000000000000..856b420221b8 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/GenerateLandingZoneResponseImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.implementation; + +import com.azure.resourcemanager.sovereign.fluent.models.GenerateLandingZoneResponseInner; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneResponse; + +public final class GenerateLandingZoneResponseImpl implements GenerateLandingZoneResponse { + private GenerateLandingZoneResponseInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + GenerateLandingZoneResponseImpl(GenerateLandingZoneResponseInner innerObject, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String topLevelMgDisplayName() { + return this.innerModel().topLevelMgDisplayName(); + } + + public String landingZoneConfigurationName() { + return this.innerModel().landingZoneConfigurationName(); + } + + public String generatedCodeUrl() { + return this.innerModel().generatedCodeUrl(); + } + + public String storageAccountName() { + return this.innerModel().storageAccountName(); + } + + public String containerName() { + return this.innerModel().containerName(); + } + + public String blobName() { + return this.innerModel().blobName(); + } + + public String generatedArmTemplate() { + return this.innerModel().generatedArmTemplate(); + } + + public GenerateLandingZoneResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsClientImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsClientImpl.java new file mode 100644 index 000000000000..89f3a4940a37 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsClientImpl.java @@ -0,0 +1,1312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.sovereign.fluent.LandingZoneAccountOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneAccountResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceListResult; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceUpdate; +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 LandingZoneAccountOperationsClient. + */ +public final class LandingZoneAccountOperationsClientImpl implements LandingZoneAccountOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LandingZoneAccountOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftSovereignImpl client; + + /** + * Initializes an instance of LandingZoneAccountOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LandingZoneAccountOperationsClientImpl(MicrosoftSovereignImpl client) { + this.service = RestProxy.create(LandingZoneAccountOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftSovereignLandingZoneAccountOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftSovereignLa") + public interface LandingZoneAccountOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Sovereign/landingZoneAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @BodyParam("application/json") LandingZoneAccountResourceInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @BodyParam("application/json") LandingZoneAccountResourceUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the landing zone accounts within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the landing zone accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the landing zone accounts within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List the landing zone accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List the landing zone accounts within a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the landing zone accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String landingZoneAccountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getByResourceGroupWithResponseAsync(String resourceGroupName, String landingZoneAccountName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context); + } + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String landingZoneAccountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, landingZoneAccountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String landingZoneAccountName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, landingZoneAccountName, context).block(); + } + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneAccountResourceInner getByResourceGroup(String resourceGroupName, String landingZoneAccountName) { + return getByResourceGroupWithResponse(resourceGroupName, landingZoneAccountName, Context.NONE).getValue(); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, LandingZoneAccountResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, LandingZoneAccountResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, resource, accept, context); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneAccountResourceInner> beginCreateAsync( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, landingZoneAccountName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LandingZoneAccountResourceInner.class, LandingZoneAccountResourceInner.class, + this.client.getContext()); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneAccountResourceInner> beginCreateAsync( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceInner resource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, landingZoneAccountName, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LandingZoneAccountResourceInner.class, LandingZoneAccountResourceInner.class, + context); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneAccountResourceInner> + beginCreate(String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceInner resource) { + return this.beginCreateAsync(resourceGroupName, landingZoneAccountName, resource).getSyncPoller(); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneAccountResourceInner> beginCreate( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceInner resource, + Context context) { + return this.beginCreateAsync(resourceGroupName, landingZoneAccountName, resource, context).getSyncPoller(); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceInner resource) { + return beginCreateAsync(resourceGroupName, landingZoneAccountName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceInner resource, Context context) { + return beginCreateAsync(resourceGroupName, landingZoneAccountName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneAccountResourceInner create(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceInner resource) { + return createAsync(resourceGroupName, landingZoneAccountName, resource).block(); + } + + /** + * Create a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneAccountResourceInner create(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceInner resource, Context context) { + return createAsync(resourceGroupName, landingZoneAccountName, resource, context).block(); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, LandingZoneAccountResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, LandingZoneAccountResourceUpdate properties, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, properties, accept, context); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneAccountResourceInner> beginUpdateAsync( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, landingZoneAccountName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LandingZoneAccountResourceInner.class, LandingZoneAccountResourceInner.class, + this.client.getContext()); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneAccountResourceInner> beginUpdateAsync( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceUpdate properties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, landingZoneAccountName, properties, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), LandingZoneAccountResourceInner.class, LandingZoneAccountResourceInner.class, + context); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneAccountResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, landingZoneAccountName, properties).getSyncPoller(); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneAccountResourceInner> beginUpdate( + String resourceGroupName, String landingZoneAccountName, LandingZoneAccountResourceUpdate properties, + Context context) { + return this.beginUpdateAsync(resourceGroupName, landingZoneAccountName, properties, context).getSyncPoller(); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceUpdate properties) { + return beginUpdateAsync(resourceGroupName, landingZoneAccountName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, landingZoneAccountName, properties, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneAccountResourceInner update(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceUpdate properties) { + return updateAsync(resourceGroupName, landingZoneAccountName, properties).block(); + } + + /** + * Update a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone account resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneAccountResourceInner update(String resourceGroupName, String landingZoneAccountName, + LandingZoneAccountResourceUpdate properties, Context context) { + return updateAsync(resourceGroupName, landingZoneAccountName, properties, context).block(); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 landingZoneAccountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, accept, context); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 landingZoneAccountName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, landingZoneAccountName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String landingZoneAccountName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, landingZoneAccountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 landingZoneAccountName) { + return this.beginDeleteAsync(resourceGroupName, landingZoneAccountName).getSyncPoller(); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String landingZoneAccountName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, landingZoneAccountName, context).getSyncPoller(); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String landingZoneAccountName) { + return beginDeleteAsync(resourceGroupName, landingZoneAccountName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String landingZoneAccountName, Context context) { + return beginDeleteAsync(resourceGroupName, landingZoneAccountName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String landingZoneAccountName) { + deleteAsync(resourceGroupName, landingZoneAccountName).block(); + } + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String landingZoneAccountName, Context context) { + deleteAsync(resourceGroupName, landingZoneAccountName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsImpl.java new file mode 100644 index 000000000000..51e7eceb64cb --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountOperationsImpl.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.sovereign.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.sovereign.fluent.LandingZoneAccountOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneAccountResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountOperations; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResource; + +public final class LandingZoneAccountOperationsImpl implements LandingZoneAccountOperations { + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneAccountOperationsImpl.class); + + private final LandingZoneAccountOperationsClient innerClient; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + public LandingZoneAccountOperationsImpl(LandingZoneAccountOperationsClient innerClient, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneAccountResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneAccountResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneAccountResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneAccountResourceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String landingZoneAccountName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, landingZoneAccountName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LandingZoneAccountResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LandingZoneAccountResource getByResourceGroup(String resourceGroupName, String landingZoneAccountName) { + LandingZoneAccountResourceInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, landingZoneAccountName); + if (inner != null) { + return new LandingZoneAccountResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String landingZoneAccountName) { + this.serviceClient().delete(resourceGroupName, landingZoneAccountName); + } + + public void delete(String resourceGroupName, String landingZoneAccountName, Context context) { + this.serviceClient().delete(resourceGroupName, landingZoneAccountName, context); + } + + public LandingZoneAccountResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, landingZoneAccountName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, landingZoneAccountName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + this.delete(resourceGroupName, landingZoneAccountName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + this.delete(resourceGroupName, landingZoneAccountName, context); + } + + private LandingZoneAccountOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } + + public LandingZoneAccountResourceImpl define(String name) { + return new LandingZoneAccountResourceImpl(name, this.manager()); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountResourceImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountResourceImpl.java new file mode 100644 index 000000000000..3fc9ed2fd356 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneAccountResourceImpl.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneAccountResourceInner; +import com.azure.resourcemanager.sovereign.models.AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceProperties; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentity; +import java.util.Collections; +import java.util.Map; + +public final class LandingZoneAccountResourceImpl + implements LandingZoneAccountResource, LandingZoneAccountResource.Definition, LandingZoneAccountResource.Update { + private LandingZoneAccountResourceInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager 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 LandingZoneAccountResourceProperties properties() { + return this.innerModel().properties(); + } + + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LandingZoneAccountResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String landingZoneAccountName; + + private LandingZoneAccountResourceUpdate updateProperties; + + public LandingZoneAccountResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public LandingZoneAccountResource create() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneAccountOperations() + .create(resourceGroupName, landingZoneAccountName, this.innerModel(), Context.NONE); + return this; + } + + public LandingZoneAccountResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneAccountOperations() + .create(resourceGroupName, landingZoneAccountName, this.innerModel(), context); + return this; + } + + LandingZoneAccountResourceImpl(String name, com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = new LandingZoneAccountResourceInner(); + this.serviceManager = serviceManager; + this.landingZoneAccountName = name; + } + + public LandingZoneAccountResourceImpl update() { + this.updateProperties = new LandingZoneAccountResourceUpdate(); + return this; + } + + public LandingZoneAccountResource apply() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneAccountOperations() + .update(resourceGroupName, landingZoneAccountName, updateProperties, Context.NONE); + return this; + } + + public LandingZoneAccountResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneAccountOperations() + .update(resourceGroupName, landingZoneAccountName, updateProperties, context); + return this; + } + + LandingZoneAccountResourceImpl(LandingZoneAccountResourceInner innerObject, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.landingZoneAccountName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "landingZoneAccounts"); + } + + public LandingZoneAccountResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneAccountOperations() + .getByResourceGroupWithResponse(resourceGroupName, landingZoneAccountName, Context.NONE) + .getValue(); + return this; + } + + public LandingZoneAccountResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneAccountOperations() + .getByResourceGroupWithResponse(resourceGroupName, landingZoneAccountName, context) + .getValue(); + return this; + } + + public LandingZoneAccountResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public LandingZoneAccountResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public LandingZoneAccountResourceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public LandingZoneAccountResourceImpl withProperties(LandingZoneAccountResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public LandingZoneAccountResourceImpl withIdentity(ManagedServiceIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public LandingZoneAccountResourceImpl withProperties(LandingZoneAccountResourcePropertiesUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } + + public LandingZoneAccountResourceImpl + withIdentity(AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity) { + this.updateProperties.withIdentity(identity); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsClientImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsClientImpl.java new file mode 100644 index 000000000000..1f30874dfaa1 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsClientImpl.java @@ -0,0 +1,2352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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.sovereign.fluent.LandingZoneConfigurationOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.CreateLandingZoneConfigurationCopyResponseInner; +import com.azure.resourcemanager.sovereign.fluent.models.GenerateLandingZoneResponseInner; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner; +import com.azure.resourcemanager.sovereign.fluent.models.UpdateAuthoringStatusResponseInner; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyRequest; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneRequest; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceListResult; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceUpdate; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusRequest; +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 LandingZoneConfigurationOperationsClient. + */ +public final class LandingZoneConfigurationOperationsClientImpl implements LandingZoneConfigurationOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LandingZoneConfigurationOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftSovereignImpl client; + + /** + * Initializes an instance of LandingZoneConfigurationOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LandingZoneConfigurationOperationsClientImpl(MicrosoftSovereignImpl client) { + this.service = RestProxy.create(LandingZoneConfigurationOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftSovereignLandingZoneConfigurationOperations to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftSovereignLa") + public interface LandingZoneConfigurationOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("landingZoneAccountName") String landingZoneAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @BodyParam("application/json") LandingZoneConfigurationResourceInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @BodyParam("application/json") LandingZoneConfigurationResourceUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}/createCopy") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createCopy(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @BodyParam("application/json") CreateLandingZoneConfigurationCopyRequest body, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}/generateLandingZone") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateLandingZone(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @BodyParam("application/json") GenerateLandingZoneRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneConfigurations/{landingZoneConfigurationName}/updateAuthoringStatus") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAuthoringStatus(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneConfigurationName") String landingZoneConfigurationName, + @BodyParam("application/json") UpdateAuthoringStatusRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionSinglePageAsync(String landingZoneAccountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), landingZoneAccountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionSinglePageAsync(String landingZoneAccountName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + landingZoneAccountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(String landingZoneAccountName) { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(landingZoneAccountName), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(String landingZoneAccountName, + Context context) { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(landingZoneAccountName, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(String landingZoneAccountName) { + return new PagedIterable<>(listBySubscriptionAsync(landingZoneAccountName)); + } + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(String landingZoneAccountName, + Context context) { + return new PagedIterable<>(listBySubscriptionAsync(landingZoneAccountName, context)); + } + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, String landingZoneAccountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, String landingZoneAccountName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String landingZoneAccountName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, landingZoneAccountName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String landingZoneAccountName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, landingZoneAccountName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, landingZoneAccountName)); + } + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, landingZoneAccountName, context)); + } + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, accept, context); + } + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName) { + return getWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context) + .block(); + } + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneConfigurationResourceInner get(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName) { + return getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, Context.NONE) + .getValue(); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource, accept, context); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneConfigurationResourceInner> + beginCreateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource) { + Mono>> mono = createWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, resource); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneConfigurationResourceInner.class, + LandingZoneConfigurationResourceInner.class, this.client.getContext()); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneConfigurationResourceInner> + beginCreateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, resource, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneConfigurationResourceInner.class, + LandingZoneConfigurationResourceInner.class, context); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneConfigurationResourceInner> + beginCreate(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource) { + return this.beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource) + .getSyncPoller(); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneConfigurationResourceInner> + beginCreate(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource, Context context) { + return this + .beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource, + context) + .getSyncPoller(); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource) { + return beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceInner resource, Context context) { + return beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneConfigurationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceInner resource) { + return createAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource).block(); + } + + /** + * Create a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneConfigurationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceInner resource, Context context) { + return createAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, resource, context) + .block(); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties, accept, context); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneConfigurationResourceInner> + beginUpdateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, properties); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneConfigurationResourceInner.class, + LandingZoneConfigurationResourceInner.class, this.client.getContext()); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneConfigurationResourceInner> + beginUpdateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, properties, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneConfigurationResourceInner.class, + LandingZoneConfigurationResourceInner.class, context); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneConfigurationResourceInner> + beginUpdate(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties) { + return this + .beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties) + .getSyncPoller(); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneConfigurationResourceInner> + beginUpdate(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties, Context context) { + return this + .beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties, + context) + .getSyncPoller(); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties) { + return beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + LandingZoneConfigurationResourceUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneConfigurationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceUpdate properties) { + return updateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties).block(); + } + + /** + * Update a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneConfigurationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, LandingZoneConfigurationResourceUpdate properties, Context context) { + return updateAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, properties, context) + .block(); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 landingZoneAccountName, String landingZoneConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, accept, context); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 landingZoneAccountName, + String landingZoneConfigurationName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 landingZoneAccountName, + String landingZoneConfigurationName) { + return this.beginDeleteAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName) + .getSyncPoller(); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, Context context) { + return this.beginDeleteAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context) + .getSyncPoller(); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName) { + return beginDeleteAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, Context context) { + return beginDeleteAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName) { + deleteAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName).block(); + } + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + Context context) { + deleteAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context).block(); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createCopyWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createCopy(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createCopyWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createCopy(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, accept, context); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, CreateLandingZoneConfigurationCopyResponseInner> + beginCreateCopyAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, CreateLandingZoneConfigurationCopyRequest body) { + Mono>> mono = createCopyWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), CreateLandingZoneConfigurationCopyResponseInner.class, + CreateLandingZoneConfigurationCopyResponseInner.class, this.client.getContext()); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, CreateLandingZoneConfigurationCopyResponseInner> + beginCreateCopyAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, CreateLandingZoneConfigurationCopyRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createCopyWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, body, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), CreateLandingZoneConfigurationCopyResponseInner.class, + CreateLandingZoneConfigurationCopyResponseInner.class, context); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, CreateLandingZoneConfigurationCopyResponseInner> + beginCreateCopy(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body) { + return this.beginCreateCopyAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body) + .getSyncPoller(); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, CreateLandingZoneConfigurationCopyResponseInner> + beginCreateCopy(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body, Context context) { + return this + .beginCreateCopyAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context) + .getSyncPoller(); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createCopyAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body) { + return beginCreateCopyAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createCopyAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body, Context context) { + return beginCreateCopyAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateLandingZoneConfigurationCopyResponseInner createCopy(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body) { + return createCopyAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body).block(); + } + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateLandingZoneConfigurationCopyResponseInner createCopy(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body, Context context) { + return createCopyAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, context) + .block(); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateLandingZoneWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, GenerateLandingZoneRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.generateLandingZone(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateLandingZoneWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, GenerateLandingZoneRequest body, + 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.generateLandingZone(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, accept, context); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response payload for generating infrastructure-as-code for the + * landing zone. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenerateLandingZoneResponseInner> + beginGenerateLandingZoneAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body) { + Mono>> mono = generateLandingZoneWithResponseAsync(resourceGroupName, + landingZoneAccountName, landingZoneConfigurationName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GenerateLandingZoneResponseInner.class, + GenerateLandingZoneResponseInner.class, this.client.getContext()); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response payload for generating infrastructure-as-code for the + * landing zone. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenerateLandingZoneResponseInner> + beginGenerateLandingZoneAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = generateLandingZoneWithResponseAsync(resourceGroupName, + landingZoneAccountName, landingZoneConfigurationName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GenerateLandingZoneResponseInner.class, + GenerateLandingZoneResponseInner.class, context); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response payload for generating infrastructure-as-code for the + * landing zone. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenerateLandingZoneResponseInner> + beginGenerateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body) { + return this + .beginGenerateLandingZoneAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body) + .getSyncPoller(); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response payload for generating infrastructure-as-code for the + * landing zone. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenerateLandingZoneResponseInner> + beginGenerateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body, Context context) { + return this + .beginGenerateLandingZoneAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, context) + .getSyncPoller(); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateLandingZoneAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, GenerateLandingZoneRequest body) { + return beginGenerateLandingZoneAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateLandingZoneAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, GenerateLandingZoneRequest body, + Context context) { + return beginGenerateLandingZoneAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateLandingZoneResponseInner generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body) { + return generateLandingZoneAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body) + .block(); + } + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenerateLandingZoneResponseInner generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body, Context context) { + return generateLandingZoneAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context).block(); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAuthoringStatusWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, UpdateAuthoringStatusRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateAuthoringStatus(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, + landingZoneConfigurationName, body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAuthoringStatusWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, + 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneConfigurationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneConfigurationName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateAuthoringStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, accept, context); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UpdateAuthoringStatusResponseInner> + beginUpdateAuthoringStatusAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body) { + Mono>> mono = updateAuthoringStatusWithResponseAsync(resourceGroupName, + landingZoneAccountName, landingZoneConfigurationName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), UpdateAuthoringStatusResponseInner.class, + UpdateAuthoringStatusResponseInner.class, this.client.getContext()); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, UpdateAuthoringStatusResponseInner> + beginUpdateAuthoringStatusAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateAuthoringStatusWithResponseAsync(resourceGroupName, + landingZoneAccountName, landingZoneConfigurationName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), UpdateAuthoringStatusResponseInner.class, + UpdateAuthoringStatusResponseInner.class, context); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UpdateAuthoringStatusResponseInner> + beginUpdateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body) { + return this + .beginUpdateAuthoringStatusAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body) + .getSyncPoller(); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, UpdateAuthoringStatusResponseInner> + beginUpdateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, Context context) { + return this + .beginUpdateAuthoringStatusAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, context) + .getSyncPoller(); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAuthoringStatusAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, UpdateAuthoringStatusRequest body) { + return beginUpdateAuthoringStatusAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAuthoringStatusAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, + Context context) { + return beginUpdateAuthoringStatusAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, + body, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateAuthoringStatusResponseInner updateAuthoringStatus(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, UpdateAuthoringStatusRequest body) { + return updateAuthoringStatusAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body) + .block(); + } + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateAuthoringStatusResponseInner updateAuthoringStatus(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, + Context context) { + return updateAuthoringStatusAsync(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsImpl.java new file mode 100644 index 000000000000..562045045fcb --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationOperationsImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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.sovereign.fluent.LandingZoneConfigurationOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.CreateLandingZoneConfigurationCopyResponseInner; +import com.azure.resourcemanager.sovereign.fluent.models.GenerateLandingZoneResponseInner; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner; +import com.azure.resourcemanager.sovereign.fluent.models.UpdateAuthoringStatusResponseInner; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyRequest; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyResponse; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneRequest; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneResponse; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationOperations; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResource; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusRequest; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusResponse; + +public final class LandingZoneConfigurationOperationsImpl implements LandingZoneConfigurationOperations { + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneConfigurationOperationsImpl.class); + + private final LandingZoneConfigurationOperationsClient innerClient; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + public LandingZoneConfigurationOperationsImpl(LandingZoneConfigurationOperationsClient innerClient, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySubscription(String landingZoneAccountName) { + PagedIterable inner + = this.serviceClient().listBySubscription(landingZoneAccountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneConfigurationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(String landingZoneAccountName, + Context context) { + PagedIterable inner + = this.serviceClient().listBySubscription(landingZoneAccountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneConfigurationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, landingZoneAccountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneConfigurationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, landingZoneAccountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneConfigurationResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LandingZoneConfigurationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LandingZoneConfigurationResource get(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName) { + LandingZoneConfigurationResourceInner inner + = this.serviceClient().get(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName); + if (inner != null) { + return new LandingZoneConfigurationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName) { + this.serviceClient().delete(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName); + } + + public void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + Context context) { + this.serviceClient().delete(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context); + } + + public CreateLandingZoneConfigurationCopyResponse createCopy(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body) { + CreateLandingZoneConfigurationCopyResponseInner inner = this.serviceClient() + .createCopy(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body); + if (inner != null) { + return new CreateLandingZoneConfigurationCopyResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public CreateLandingZoneConfigurationCopyResponse createCopy(String resourceGroupName, + String landingZoneAccountName, String landingZoneConfigurationName, + CreateLandingZoneConfigurationCopyRequest body, Context context) { + CreateLandingZoneConfigurationCopyResponseInner inner = this.serviceClient() + .createCopy(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, context); + if (inner != null) { + return new CreateLandingZoneConfigurationCopyResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenerateLandingZoneResponse generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body) { + GenerateLandingZoneResponseInner inner = this.serviceClient() + .generateLandingZone(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body); + if (inner != null) { + return new GenerateLandingZoneResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenerateLandingZoneResponse generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body, Context context) { + GenerateLandingZoneResponseInner inner = this.serviceClient() + .generateLandingZone(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context); + if (inner != null) { + return new GenerateLandingZoneResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateAuthoringStatusResponse updateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body) { + UpdateAuthoringStatusResponseInner inner = this.serviceClient() + .updateAuthoringStatus(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body); + if (inner != null) { + return new UpdateAuthoringStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public UpdateAuthoringStatusResponse updateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, Context context) { + UpdateAuthoringStatusResponseInner inner = this.serviceClient() + .updateAuthoringStatus(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context); + if (inner != null) { + return new UpdateAuthoringStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public LandingZoneConfigurationResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneConfigurations"); + if (landingZoneConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneConfigurations'.", id))); + } + return this + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneConfigurations"); + if (landingZoneConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneConfigurations'.", id))); + } + return this.getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneConfigurations"); + if (landingZoneConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneConfigurations'.", id))); + } + this.delete(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneConfigurationName + = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneConfigurations"); + if (landingZoneConfigurationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneConfigurations'.", id))); + } + this.delete(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context); + } + + private LandingZoneConfigurationOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } + + public LandingZoneConfigurationResourceImpl define(String name) { + return new LandingZoneConfigurationResourceImpl(name, this.manager()); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationResourceImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationResourceImpl.java new file mode 100644 index 000000000000..532cb377c4f4 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneConfigurationResourceImpl.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.sovereign.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyRequest; +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyResponse; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneRequest; +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneResponse; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceProperties; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceUpdate; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusRequest; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusResponse; + +public final class LandingZoneConfigurationResourceImpl implements LandingZoneConfigurationResource, + LandingZoneConfigurationResource.Definition, LandingZoneConfigurationResource.Update { + private LandingZoneConfigurationResourceInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LandingZoneConfigurationResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LandingZoneConfigurationResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String landingZoneAccountName; + + private String landingZoneConfigurationName; + + private LandingZoneConfigurationResourceUpdate updateProperties; + + public LandingZoneConfigurationResourceImpl withExistingLandingZoneAccount(String resourceGroupName, + String landingZoneAccountName) { + this.resourceGroupName = resourceGroupName; + this.landingZoneAccountName = landingZoneAccountName; + return this; + } + + public LandingZoneConfigurationResource create() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneConfigurationOperations() + .create(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, this.innerModel(), + Context.NONE); + return this; + } + + public LandingZoneConfigurationResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneConfigurationOperations() + .create(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, this.innerModel(), + context); + return this; + } + + LandingZoneConfigurationResourceImpl(String name, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = new LandingZoneConfigurationResourceInner(); + this.serviceManager = serviceManager; + this.landingZoneConfigurationName = name; + } + + public LandingZoneConfigurationResourceImpl update() { + this.updateProperties = new LandingZoneConfigurationResourceUpdate(); + return this; + } + + public LandingZoneConfigurationResource apply() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneConfigurationOperations() + .update(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, updateProperties, + Context.NONE); + return this; + } + + public LandingZoneConfigurationResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneConfigurationOperations() + .update(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, updateProperties, context); + return this; + } + + LandingZoneConfigurationResourceImpl(LandingZoneConfigurationResourceInner innerObject, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.landingZoneAccountName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "landingZoneAccounts"); + this.landingZoneConfigurationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "landingZoneConfigurations"); + } + + public LandingZoneConfigurationResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneConfigurationOperations() + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, Context.NONE) + .getValue(); + return this; + } + + public LandingZoneConfigurationResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneConfigurationOperations() + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, context) + .getValue(); + return this; + } + + public CreateLandingZoneConfigurationCopyResponse createCopy(CreateLandingZoneConfigurationCopyRequest body) { + return serviceManager.landingZoneConfigurationOperations() + .createCopy(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body); + } + + public CreateLandingZoneConfigurationCopyResponse createCopy(CreateLandingZoneConfigurationCopyRequest body, + Context context) { + return serviceManager.landingZoneConfigurationOperations() + .createCopy(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, context); + } + + public GenerateLandingZoneResponse generateLandingZone(GenerateLandingZoneRequest body) { + return serviceManager.landingZoneConfigurationOperations() + .generateLandingZone(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body); + } + + public GenerateLandingZoneResponse generateLandingZone(GenerateLandingZoneRequest body, Context context) { + return serviceManager.landingZoneConfigurationOperations() + .generateLandingZone(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context); + } + + public UpdateAuthoringStatusResponse updateAuthoringStatus(UpdateAuthoringStatusRequest body) { + return serviceManager.landingZoneConfigurationOperations() + .updateAuthoringStatus(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body); + } + + public UpdateAuthoringStatusResponse updateAuthoringStatus(UpdateAuthoringStatusRequest body, Context context) { + return serviceManager.landingZoneConfigurationOperations() + .updateAuthoringStatus(resourceGroupName, landingZoneAccountName, landingZoneConfigurationName, body, + context); + } + + public LandingZoneConfigurationResourceImpl withProperties(LandingZoneConfigurationResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public LandingZoneConfigurationResourceImpl + withProperties(LandingZoneConfigurationResourcePropertiesUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsClientImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsClientImpl.java new file mode 100644 index 000000000000..9befaf0be512 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsClientImpl.java @@ -0,0 +1,1370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.sovereign.fluent.LandingZoneRegistrationOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneRegistrationResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceListResult; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceUpdate; +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 LandingZoneRegistrationOperationsClient. + */ +public final class LandingZoneRegistrationOperationsClientImpl implements LandingZoneRegistrationOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final LandingZoneRegistrationOperationsService service; + + /** + * The service client containing this operation class. + */ + private final MicrosoftSovereignImpl client; + + /** + * Initializes an instance of LandingZoneRegistrationOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LandingZoneRegistrationOperationsClientImpl(MicrosoftSovereignImpl client) { + this.service = RestProxy.create(LandingZoneRegistrationOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftSovereignLandingZoneRegistrationOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftSovereignLa") + public interface LandingZoneRegistrationOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneRegistrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("landingZoneAccountName") String landingZoneAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneRegistrations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneRegistrations/{landingZoneRegistrationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneRegistrationName") String landingZoneRegistrationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneRegistrations/{landingZoneRegistrationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneRegistrationName") String landingZoneRegistrationName, + @BodyParam("application/json") LandingZoneRegistrationResourceInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneRegistrations/{landingZoneRegistrationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneRegistrationName") String landingZoneRegistrationName, + @BodyParam("application/json") LandingZoneRegistrationResourceUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sovereign/landingZoneAccounts/{landingZoneAccountName}/landingZoneRegistrations/{landingZoneRegistrationName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("landingZoneAccountName") String landingZoneAccountName, + @PathParam("landingZoneRegistrationName") String landingZoneRegistrationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionSinglePageAsync(String landingZoneAccountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), landingZoneAccountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionSinglePageAsync(String landingZoneAccountName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + landingZoneAccountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(String landingZoneAccountName) { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(landingZoneAccountName), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync(String landingZoneAccountName, + Context context) { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(landingZoneAccountName, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(String landingZoneAccountName) { + return new PagedIterable<>(listBySubscriptionAsync(landingZoneAccountName)); + } + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(String landingZoneAccountName, + Context context) { + return new PagedIterable<>(listBySubscriptionAsync(landingZoneAccountName, context)); + } + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, String landingZoneAccountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, String landingZoneAccountName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String landingZoneAccountName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, landingZoneAccountName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String landingZoneAccountName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, landingZoneAccountName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, landingZoneAccountName)); + } + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, landingZoneAccountName, context)); + } + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, accept, context); + } + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName) { + return getWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, Context context) { + return getWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context) + .block(); + } + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneRegistrationResourceInner get(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName) { + return getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, Context.NONE) + .getValue(); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, + resource, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource, accept, context); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneRegistrationResourceInner> + beginCreateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneRegistrationResourceInner.class, + LandingZoneRegistrationResourceInner.class, this.client.getContext()); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneRegistrationResourceInner> + beginCreateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneRegistrationName, resource, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneRegistrationResourceInner.class, + LandingZoneRegistrationResourceInner.class, context); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneRegistrationResourceInner> + beginCreate(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource) { + return this.beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource) + .getSyncPoller(); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneRegistrationResourceInner> + beginCreate(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource, Context context) { + return this + .beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource, context) + .getSyncPoller(); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource) { + return beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceInner resource, Context context) { + return beginCreateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneRegistrationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceInner resource) { + return createAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource).block(); + } + + /** + * Create a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneRegistrationResourceInner create(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceInner resource, Context context) { + return createAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, resource, context) + .block(); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, + properties, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties, accept, context); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneRegistrationResourceInner> + beginUpdateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneRegistrationName, properties); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneRegistrationResourceInner.class, + LandingZoneRegistrationResourceInner.class, this.client.getContext()); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, LandingZoneRegistrationResourceInner> + beginUpdateAsync(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, landingZoneAccountName, + landingZoneRegistrationName, properties, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), LandingZoneRegistrationResourceInner.class, + LandingZoneRegistrationResourceInner.class, context); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneRegistrationResourceInner> + beginUpdate(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties) + .getSyncPoller(); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, LandingZoneRegistrationResourceInner> + beginUpdate(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties, Context context) { + return this + .beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties, + context) + .getSyncPoller(); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties) { + return beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, + LandingZoneRegistrationResourceUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneRegistrationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceUpdate properties) { + return updateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties).block(); + } + + /** + * Update a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Landing zone registration resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LandingZoneRegistrationResourceInner update(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, LandingZoneRegistrationResourceUpdate properties, Context context) { + return updateAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, properties, context) + .block(); + } + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, 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 (landingZoneAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneAccountName is required and cannot be null.")); + } + if (landingZoneRegistrationName == null) { + return Mono.error( + new IllegalArgumentException("Parameter landingZoneRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, accept, context); + } + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName) { + return deleteWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context) + .block(); + } + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName) { + deleteWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsImpl.java new file mode 100644 index 000000000000..d72d26e55c94 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationOperationsImpl.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.sovereign.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.sovereign.fluent.LandingZoneRegistrationOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneRegistrationResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationOperations; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResource; + +public final class LandingZoneRegistrationOperationsImpl implements LandingZoneRegistrationOperations { + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneRegistrationOperationsImpl.class); + + private final LandingZoneRegistrationOperationsClient innerClient; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + public LandingZoneRegistrationOperationsImpl(LandingZoneRegistrationOperationsClient innerClient, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySubscription(String landingZoneAccountName) { + PagedIterable inner + = this.serviceClient().listBySubscription(landingZoneAccountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneRegistrationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(String landingZoneAccountName, + Context context) { + PagedIterable inner + = this.serviceClient().listBySubscription(landingZoneAccountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneRegistrationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, landingZoneAccountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneRegistrationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, landingZoneAccountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new LandingZoneRegistrationResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, + String landingZoneAccountName, String landingZoneRegistrationName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LandingZoneRegistrationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LandingZoneRegistrationResource get(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName) { + LandingZoneRegistrationResourceInner inner + = this.serviceClient().get(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName); + if (inner != null) { + return new LandingZoneRegistrationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context); + } + + public void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName) { + this.serviceClient().delete(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName); + } + + public LandingZoneRegistrationResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneRegistrationName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneRegistrations"); + if (landingZoneRegistrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneRegistrations'.", id))); + } + return this + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneRegistrationName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneRegistrations"); + if (landingZoneRegistrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneRegistrations'.", id))); + } + return this.getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneRegistrationName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneRegistrations"); + if (landingZoneRegistrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneRegistrations'.", id))); + } + this.deleteWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String landingZoneAccountName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneAccounts"); + if (landingZoneAccountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'landingZoneAccounts'.", id))); + } + String landingZoneRegistrationName = ResourceManagerUtils.getValueFromIdByName(id, "landingZoneRegistrations"); + if (landingZoneRegistrationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'landingZoneRegistrations'.", id))); + } + return this.deleteWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context); + } + + private LandingZoneRegistrationOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } + + public LandingZoneRegistrationResourceImpl define(String name) { + return new LandingZoneRegistrationResourceImpl(name, this.manager()); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationResourceImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationResourceImpl.java new file mode 100644 index 000000000000..0e79c0a4fa78 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/LandingZoneRegistrationResourceImpl.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.sovereign.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneRegistrationResourceInner; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceProperties; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceUpdate; + +public final class LandingZoneRegistrationResourceImpl implements LandingZoneRegistrationResource, + LandingZoneRegistrationResource.Definition, LandingZoneRegistrationResource.Update { + private LandingZoneRegistrationResourceInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public LandingZoneRegistrationResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public LandingZoneRegistrationResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String landingZoneAccountName; + + private String landingZoneRegistrationName; + + private LandingZoneRegistrationResourceUpdate updateProperties; + + public LandingZoneRegistrationResourceImpl withExistingLandingZoneAccount(String resourceGroupName, + String landingZoneAccountName) { + this.resourceGroupName = resourceGroupName; + this.landingZoneAccountName = landingZoneAccountName; + return this; + } + + public LandingZoneRegistrationResource create() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneRegistrationOperations() + .create(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, this.innerModel(), + Context.NONE); + return this; + } + + public LandingZoneRegistrationResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneRegistrationOperations() + .create(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, this.innerModel(), context); + return this; + } + + LandingZoneRegistrationResourceImpl(String name, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = new LandingZoneRegistrationResourceInner(); + this.serviceManager = serviceManager; + this.landingZoneRegistrationName = name; + } + + public LandingZoneRegistrationResourceImpl update() { + this.updateProperties = new LandingZoneRegistrationResourceUpdate(); + return this; + } + + public LandingZoneRegistrationResource apply() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneRegistrationOperations() + .update(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, updateProperties, + Context.NONE); + return this; + } + + public LandingZoneRegistrationResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneRegistrationOperations() + .update(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, updateProperties, context); + return this; + } + + LandingZoneRegistrationResourceImpl(LandingZoneRegistrationResourceInner innerObject, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.landingZoneAccountName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "landingZoneAccounts"); + this.landingZoneRegistrationName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "landingZoneRegistrations"); + } + + public LandingZoneRegistrationResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneRegistrationOperations() + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, Context.NONE) + .getValue(); + return this; + } + + public LandingZoneRegistrationResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLandingZoneRegistrationOperations() + .getWithResponse(resourceGroupName, landingZoneAccountName, landingZoneRegistrationName, context) + .getValue(); + return this; + } + + public LandingZoneRegistrationResourceImpl withProperties(LandingZoneRegistrationResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public LandingZoneRegistrationResourceImpl + withProperties(LandingZoneRegistrationResourcePropertiesUpdate properties) { + this.updateProperties.withProperties(properties); + return this; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignBuilder.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignBuilder.java new file mode 100644 index 000000000000..6c4d5dfeb165 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignBuilder.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.sovereign.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.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 MicrosoftSovereignImpl type. + */ +@ServiceClientBuilder(serviceClients = { MicrosoftSovereignImpl.class }) +public final class MicrosoftSovereignBuilder { + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the MicrosoftSovereignBuilder. + */ + public MicrosoftSovereignBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the MicrosoftSovereignBuilder. + */ + public MicrosoftSovereignBuilder 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 MicrosoftSovereignBuilder. + */ + public MicrosoftSovereignBuilder environment(AzureEnvironment environment) { + this.environment = environment; + 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 MicrosoftSovereignBuilder. + */ + public MicrosoftSovereignBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + 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 MicrosoftSovereignBuilder. + */ + public MicrosoftSovereignBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + 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 MicrosoftSovereignBuilder. + */ + public MicrosoftSovereignBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of MicrosoftSovereignImpl with the provided parameters. + * + * @return an instance of MicrosoftSovereignImpl. + */ + public MicrosoftSovereignImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + MicrosoftSovereignImpl client = new MicrosoftSovereignImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignImpl.java new file mode 100644 index 000000000000..98fa24b5e0a0 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/MicrosoftSovereignImpl.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +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.CoreUtils; +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.sovereign.fluent.LandingZoneAccountOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.LandingZoneConfigurationOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.LandingZoneRegistrationOperationsClient; +import com.azure.resourcemanager.sovereign.fluent.MicrosoftSovereign; +import com.azure.resourcemanager.sovereign.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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the MicrosoftSovereignImpl type. + */ +@ServiceClient(builder = MicrosoftSovereignBuilder.class) +public final class MicrosoftSovereignImpl implements MicrosoftSovereign { + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * 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 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 LandingZoneAccountOperationsClient object to access its operations. + */ + private final LandingZoneAccountOperationsClient landingZoneAccountOperations; + + /** + * Gets the LandingZoneAccountOperationsClient object to access its operations. + * + * @return the LandingZoneAccountOperationsClient object. + */ + public LandingZoneAccountOperationsClient getLandingZoneAccountOperations() { + return this.landingZoneAccountOperations; + } + + /** + * The LandingZoneConfigurationOperationsClient object to access its operations. + */ + private final LandingZoneConfigurationOperationsClient landingZoneConfigurationOperations; + + /** + * Gets the LandingZoneConfigurationOperationsClient object to access its operations. + * + * @return the LandingZoneConfigurationOperationsClient object. + */ + public LandingZoneConfigurationOperationsClient getLandingZoneConfigurationOperations() { + return this.landingZoneConfigurationOperations; + } + + /** + * The LandingZoneRegistrationOperationsClient object to access its operations. + */ + private final LandingZoneRegistrationOperationsClient landingZoneRegistrationOperations; + + /** + * Gets the LandingZoneRegistrationOperationsClient object to access its operations. + * + * @return the LandingZoneRegistrationOperationsClient object. + */ + public LandingZoneRegistrationOperationsClient getLandingZoneRegistrationOperations() { + return this.landingZoneRegistrationOperations; + } + + /** + * Initializes an instance of MicrosoftSovereign 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. The value must be an UUID. + * @param endpoint server parameter. + */ + MicrosoftSovereignImpl(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 = "2025-02-27-preview"; + this.operations = new OperationsClientImpl(this); + this.landingZoneAccountOperations = new LandingZoneAccountOperationsClientImpl(this); + this.landingZoneConfigurationOperations = new LandingZoneConfigurationOperationsClientImpl(this); + this.landingZoneRegistrationOperations = new LandingZoneRegistrationOperationsClientImpl(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) { + return CoreUtils.mergeContexts(this.getContext(), 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(HttpHeaderName.fromString(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(MicrosoftSovereignImpl.class); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationImpl.java new file mode 100644 index 000000000000..f11e5ba8b1b3 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationImpl.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.sovereign.implementation; + +import com.azure.resourcemanager.sovereign.fluent.models.OperationInner; +import com.azure.resourcemanager.sovereign.models.ActionType; +import com.azure.resourcemanager.sovereign.models.Operation; +import com.azure.resourcemanager.sovereign.models.OperationDisplay; +import com.azure.resourcemanager.sovereign.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.sovereign.SovereignManager 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 Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsClientImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..ad2974eaa18c --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.sovereign.fluent.OperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.OperationInner; +import com.azure.resourcemanager.sovereign.models.OperationListResult; +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 MicrosoftSovereignImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(MicrosoftSovereignImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for MicrosoftSovereignOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "MicrosoftSovereignOp") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Sovereign/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.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(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider 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())); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider 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)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider 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 URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider 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/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/OperationsImpl.java new file mode 100644 index 000000000000..6f4737a4ebdc --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/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.sovereign.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.sovereign.fluent.OperationsClient; +import com.azure.resourcemanager.sovereign.fluent.models.OperationInner; +import com.azure.resourcemanager.sovereign.models.Operation; +import com.azure.resourcemanager.sovereign.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.sovereign.SovereignManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/ResourceManagerUtils.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..67532f8ccdfc --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/ResourceManagerUtils.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.sovereign.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 ResourceManagerUtils { + private ResourceManagerUtils() { + } + + 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(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/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/UpdateAuthoringStatusResponseImpl.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/UpdateAuthoringStatusResponseImpl.java new file mode 100644 index 000000000000..f894922a7507 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/UpdateAuthoringStatusResponseImpl.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.sovereign.implementation; + +import com.azure.resourcemanager.sovereign.fluent.models.UpdateAuthoringStatusResponseInner; +import com.azure.resourcemanager.sovereign.models.AuthoringStatus; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusResponse; + +public final class UpdateAuthoringStatusResponseImpl implements UpdateAuthoringStatusResponse { + private UpdateAuthoringStatusResponseInner innerObject; + + private final com.azure.resourcemanager.sovereign.SovereignManager serviceManager; + + UpdateAuthoringStatusResponseImpl(UpdateAuthoringStatusResponseInner innerObject, + com.azure.resourcemanager.sovereign.SovereignManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String landingZoneConfigurationName() { + return this.innerModel().landingZoneConfigurationName(); + } + + public AuthoringStatus authoringStatus() { + return this.innerModel().authoringStatus(); + } + + public UpdateAuthoringStatusResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.sovereign.SovereignManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/package-info.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/package-info.java new file mode 100644 index 000000000000..c6e4c75d3e0c --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/implementation/package-info.java @@ -0,0 +1,9 @@ +// 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 MicrosoftSovereign. + * null. + */ +package com.azure.resourcemanager.sovereign.implementation; diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ActionType.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ActionType.java new file mode 100644 index 000000000000..210e512f1b31 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ActionType.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.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AuthoringStatus.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AuthoringStatus.java new file mode 100644 index 000000000000..d4126441507d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AuthoringStatus.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The authoring status for a landing zone configuration. + */ +public final class AuthoringStatus extends ExpandableStringEnum { + /** + * Static value Authoring for AuthoringStatus. + */ + public static final AuthoringStatus AUTHORING = fromString("Authoring"); + + /** + * Static value ReadyForUse for AuthoringStatus. + */ + public static final AuthoringStatus READY_FOR_USE = fromString("ReadyForUse"); + + /** + * Static value Disabled for AuthoringStatus. + */ + public static final AuthoringStatus DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of AuthoringStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AuthoringStatus() { + } + + /** + * Creates or finds a AuthoringStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthoringStatus. + */ + public static AuthoringStatus fromString(String name) { + return fromString(name, AuthoringStatus.class); + } + + /** + * Gets known AuthoringStatus values. + * + * @return known AuthoringStatus values. + */ + public static Collection values() { + return values(AuthoringStatus.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java new file mode 100644 index 000000000000..6cd2b3acf258 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class AzureResourceManagerCommonTypesManagedServiceIdentityUpdate + implements JsonSerializable { + /* + * The type of managed identity assigned to this resource. + */ + private ManagedServiceIdentityType type; + + /* + * The identities assigned to this resource by the user. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of AzureResourceManagerCommonTypesManagedServiceIdentityUpdate class. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate() { + } + + /** + * Get the type property: The type of managed identity assigned to this resource. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity assigned to this resource. + * + * @param type the type value to set. + * @return the AzureResourceManagerCommonTypesManagedServiceIdentityUpdate object itself. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the AzureResourceManagerCommonTypesManagedServiceIdentityUpdate object itself. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate + withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerCommonTypesManagedServiceIdentityUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerCommonTypesManagedServiceIdentityUpdate if the JsonReader was pointing + * to an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the + * AzureResourceManagerCommonTypesManagedServiceIdentityUpdate. + */ + public static AzureResourceManagerCommonTypesManagedServiceIdentityUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerCommonTypesManagedServiceIdentityUpdate deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate + = new AzureResourceManagerCommonTypesManagedServiceIdentityUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate.type + = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentities.fromJson(reader1)); + deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate.userAssignedIdentities + = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerCommonTypesManagedServiceIdentityUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java new file mode 100644 index 000000000000..762f143d5f70 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/AzureResourceManagerCommonTypesTrackedResourceUpdate.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a + * 'location'. + */ +@Fluent +public class AzureResourceManagerCommonTypesTrackedResourceUpdate extends ProxyResource { + /* + * Resource tags. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AzureResourceManagerCommonTypesTrackedResourceUpdate class. + */ + public AzureResourceManagerCommonTypesTrackedResourceUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the AzureResourceManagerCommonTypesTrackedResourceUpdate object itself. + */ + public AzureResourceManagerCommonTypesTrackedResourceUpdate withTags(Map tags) { + this.tags = tags; + 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; + } + + /** + * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @param systemData the systemData value to set. + * @return the AzureResourceManagerCommonTypesTrackedResourceUpdate object itself. + */ + AzureResourceManagerCommonTypesTrackedResourceUpdate withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureResourceManagerCommonTypesTrackedResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureResourceManagerCommonTypesTrackedResourceUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureResourceManagerCommonTypesTrackedResourceUpdate. + */ + public static AzureResourceManagerCommonTypesTrackedResourceUpdate fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + AzureResourceManagerCommonTypesTrackedResourceUpdate deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate + = new AzureResourceManagerCommonTypesTrackedResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureResourceManagerCommonTypesTrackedResourceUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyRequest.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyRequest.java new file mode 100644 index 000000000000..c8e4cfd5595e --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyRequest.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The request for create duplicate landing zone configuration. + */ +@Fluent +public final class CreateLandingZoneConfigurationCopyRequest + implements JsonSerializable { + /* + * The name of the duplicate landing zone configuration resource. + */ + private String name; + + /** + * Creates an instance of CreateLandingZoneConfigurationCopyRequest class. + */ + public CreateLandingZoneConfigurationCopyRequest() { + } + + /** + * Get the name property: The name of the duplicate landing zone configuration resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the duplicate landing zone configuration resource. + * + * @param name the name value to set. + * @return the CreateLandingZoneConfigurationCopyRequest object itself. + */ + public CreateLandingZoneConfigurationCopyRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model CreateLandingZoneConfigurationCopyRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateLandingZoneConfigurationCopyRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateLandingZoneConfigurationCopyRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateLandingZoneConfigurationCopyRequest if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateLandingZoneConfigurationCopyRequest. + */ + public static CreateLandingZoneConfigurationCopyRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateLandingZoneConfigurationCopyRequest deserializedCreateLandingZoneConfigurationCopyRequest + = new CreateLandingZoneConfigurationCopyRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCreateLandingZoneConfigurationCopyRequest.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateLandingZoneConfigurationCopyRequest; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyResponse.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyResponse.java new file mode 100644 index 000000000000..182ccb7d5154 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CreateLandingZoneConfigurationCopyResponse.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.resourcemanager.sovereign.fluent.models.CreateLandingZoneConfigurationCopyResponseInner; + +/** + * An immutable client-side representation of CreateLandingZoneConfigurationCopyResponse. + */ +public interface CreateLandingZoneConfigurationCopyResponse { + /** + * Gets the copiedLandingZoneConfigurationId property: The ID of the duplicate landing zone configuration resource. + * + * @return the copiedLandingZoneConfigurationId value. + */ + String copiedLandingZoneConfigurationId(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.CreateLandingZoneConfigurationCopyResponseInner + * object. + * + * @return the inner object. + */ + CreateLandingZoneConfigurationCopyResponseInner innerModel(); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CustomNamingConvention.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CustomNamingConvention.java new file mode 100644 index 000000000000..659d08f84a7a --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/CustomNamingConvention.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The details for the custom naming convention override for a specific resource type. + */ +@Fluent +public final class CustomNamingConvention implements JsonSerializable { + /* + * The type of the resource. + */ + private ResourceType resourceType; + + /* + * The custom naming formula for the resource type. + */ + private String formula; + + /** + * Creates an instance of CustomNamingConvention class. + */ + public CustomNamingConvention() { + } + + /** + * Get the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + public ResourceType resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The type of the resource. + * + * @param resourceType the resourceType value to set. + * @return the CustomNamingConvention object itself. + */ + public CustomNamingConvention withResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the formula property: The custom naming formula for the resource type. + * + * @return the formula value. + */ + public String formula() { + return this.formula; + } + + /** + * Set the formula property: The custom naming formula for the resource type. + * + * @param formula the formula value to set. + * @return the CustomNamingConvention object itself. + */ + public CustomNamingConvention withFormula(String formula) { + this.formula = formula; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resourceType in model CustomNamingConvention")); + } + if (formula() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property formula in model CustomNamingConvention")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomNamingConvention.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); + jsonWriter.writeStringField("formula", this.formula); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomNamingConvention from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomNamingConvention if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomNamingConvention. + */ + public static CustomNamingConvention fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomNamingConvention deserializedCustomNamingConvention = new CustomNamingConvention(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceType".equals(fieldName)) { + deserializedCustomNamingConvention.resourceType = ResourceType.fromString(reader.getString()); + } else if ("formula".equals(fieldName)) { + deserializedCustomNamingConvention.formula = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomNamingConvention; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupProperties.java new file mode 100644 index 000000000000..6c09f9c26df4 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupProperties.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The 'Decommissioned' management group properties. + */ +@Fluent +public final class DecommissionedManagementGroupProperties + implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /* + * This parameter determines whether the 'Decommissioned' management group will be created. If set to true, the + * group will be created; if set to false, it will not be created. The default value is false. + */ + private boolean create; + + /** + * Creates an instance of DecommissionedManagementGroupProperties class. + */ + public DecommissionedManagementGroupProperties() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the DecommissionedManagementGroupProperties object itself. + */ + public DecommissionedManagementGroupProperties withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Get the create property: This parameter determines whether the 'Decommissioned' management group will be created. + * If set to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @return the create value. + */ + public boolean create() { + return this.create; + } + + /** + * Set the create property: This parameter determines whether the 'Decommissioned' management group will be created. + * If set to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @param create the create value to set. + * @return the DecommissionedManagementGroupProperties object itself. + */ + public DecommissionedManagementGroupProperties withCreate(boolean create) { + this.create = create; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyInitiativesAssignmentProperties in model DecommissionedManagementGroupProperties")); + } else { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DecommissionedManagementGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("create", this.create); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DecommissionedManagementGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DecommissionedManagementGroupProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DecommissionedManagementGroupProperties. + */ + public static DecommissionedManagementGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DecommissionedManagementGroupProperties deserializedDecommissionedManagementGroupProperties + = new DecommissionedManagementGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedDecommissionedManagementGroupProperties.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else if ("create".equals(fieldName)) { + deserializedDecommissionedManagementGroupProperties.create = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedDecommissionedManagementGroupProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupPropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupPropertiesUpdate.java new file mode 100644 index 000000000000..aa7f379f8784 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/DecommissionedManagementGroupPropertiesUpdate.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The 'Decommissioned' management group properties. + */ +@Fluent +public final class DecommissionedManagementGroupPropertiesUpdate + implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /* + * This parameter determines whether the 'Decommissioned' management group will be created. If set to true, the + * group will be created; if set to false, it will not be created. The default value is false. + */ + private Boolean create; + + /** + * Creates an instance of DecommissionedManagementGroupPropertiesUpdate class. + */ + public DecommissionedManagementGroupPropertiesUpdate() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the DecommissionedManagementGroupPropertiesUpdate object itself. + */ + public DecommissionedManagementGroupPropertiesUpdate withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Get the create property: This parameter determines whether the 'Decommissioned' management group will be created. + * If set to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @return the create value. + */ + public Boolean create() { + return this.create; + } + + /** + * Set the create property: This parameter determines whether the 'Decommissioned' management group will be created. + * If set to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @param create the create value to set. + * @return the DecommissionedManagementGroupPropertiesUpdate object itself. + */ + public DecommissionedManagementGroupPropertiesUpdate withCreate(Boolean create) { + this.create = create; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() != null) { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("create", this.create); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DecommissionedManagementGroupPropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DecommissionedManagementGroupPropertiesUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DecommissionedManagementGroupPropertiesUpdate. + */ + public static DecommissionedManagementGroupPropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DecommissionedManagementGroupPropertiesUpdate deserializedDecommissionedManagementGroupPropertiesUpdate + = new DecommissionedManagementGroupPropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedDecommissionedManagementGroupPropertiesUpdate.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else if ("create".equals(fieldName)) { + deserializedDecommissionedManagementGroupPropertiesUpdate.create + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDecommissionedManagementGroupPropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/FirewallCreationOptions.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/FirewallCreationOptions.java new file mode 100644 index 000000000000..bb868f76ee4c --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/FirewallCreationOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Parameter used for deploying or not a Firewall resource. + */ +public final class FirewallCreationOptions extends ExpandableStringEnum { + /** + * Static value None for FirewallCreationOptions. + */ + public static final FirewallCreationOptions NONE = fromString("None"); + + /** + * Static value Standard for FirewallCreationOptions. + */ + public static final FirewallCreationOptions STANDARD = fromString("Standard"); + + /** + * Static value Premium for FirewallCreationOptions. + */ + public static final FirewallCreationOptions PREMIUM = fromString("Premium"); + + /** + * Creates a new instance of FirewallCreationOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallCreationOptions() { + } + + /** + * Creates or finds a FirewallCreationOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallCreationOptions. + */ + public static FirewallCreationOptions fromString(String name) { + return fromString(name, FirewallCreationOptions.class); + } + + /** + * Gets known FirewallCreationOptions values. + * + * @return known FirewallCreationOptions values. + */ + public static Collection values() { + return values(FirewallCreationOptions.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneRequest.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneRequest.java new file mode 100644 index 000000000000..58fcd1d44b9c --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneRequest.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The request to generate Infrastructure as Code (IaC) for a landing zone. + */ +@Fluent +public final class GenerateLandingZoneRequest implements JsonSerializable { + /* + * The export options available for code generation. + */ + private InfrastructureAsCodeOutputOptions infrastructureAsCodeOutputOptions; + + /* + * Existing 'Management' subscription ID to be linked with this deployment when reusing instead of creating a new + * subscription. + */ + private String existingManagementSubscriptionId; + + /* + * Existing 'Identity' subscription ID to be linked with this deployment when reusing instead of creating a new + * subscription. + */ + private String existingIdentitySubscriptionId; + + /* + * Existing 'Connectivity' subscription ID to be linked with this deployment when reusing instead of creating a new + * subscription. + */ + private String existingConnectivitySubscriptionId; + + /* + * The complete resource ID of the billing scope linked to the EA, MCA, or MPA account where you want to create the + * subscription. + */ + private String subscriptionBillingScope; + + /* + * Optional parent for the management group hierarchy, serving as an intermediate root management group parent if + * specified. If left empty, the default will be to deploy under the tenant root management group. + */ + private String existingTopLevelMgParentId; + + /* + * The prefix that will be added to all resources created by this deployment. Use between 2 and 5 characters, + * consisting only of letters, digits, '-', '.', or '_'. No other special characters are supported. + */ + private String deploymentPrefix; + + /* + * The optional suffix that will be appended to all resources created by this deployment, maximum 5 characters. + */ + private String deploymentSuffix; + + /* + * The display name assigned to the top management group of the landing zone deployment hierarchy. It is recommended + * to use unique names for each landing zone deployment. + */ + private String topLevelMgDisplayName; + + /* + * The Azure region where the landing zone will be deployed. All Azure regions are supported. + */ + private String deploymentLocation; + + /* + * The name of the organization or agency for which the landing zone is being deployed. This is optional. + */ + private String organization; + + /* + * The environment where the landing zone is being deployed, such as ppe, prod, test, etc. + */ + private String environment; + + /** + * Creates an instance of GenerateLandingZoneRequest class. + */ + public GenerateLandingZoneRequest() { + } + + /** + * Get the infrastructureAsCodeOutputOptions property: The export options available for code generation. + * + * @return the infrastructureAsCodeOutputOptions value. + */ + public InfrastructureAsCodeOutputOptions infrastructureAsCodeOutputOptions() { + return this.infrastructureAsCodeOutputOptions; + } + + /** + * Set the infrastructureAsCodeOutputOptions property: The export options available for code generation. + * + * @param infrastructureAsCodeOutputOptions the infrastructureAsCodeOutputOptions value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest + withInfrastructureAsCodeOutputOptions(InfrastructureAsCodeOutputOptions infrastructureAsCodeOutputOptions) { + this.infrastructureAsCodeOutputOptions = infrastructureAsCodeOutputOptions; + return this; + } + + /** + * Get the existingManagementSubscriptionId property: Existing 'Management' subscription ID to be linked with this + * deployment when reusing instead of creating a new subscription. + * + * @return the existingManagementSubscriptionId value. + */ + public String existingManagementSubscriptionId() { + return this.existingManagementSubscriptionId; + } + + /** + * Set the existingManagementSubscriptionId property: Existing 'Management' subscription ID to be linked with this + * deployment when reusing instead of creating a new subscription. + * + * @param existingManagementSubscriptionId the existingManagementSubscriptionId value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withExistingManagementSubscriptionId(String existingManagementSubscriptionId) { + this.existingManagementSubscriptionId = existingManagementSubscriptionId; + return this; + } + + /** + * Get the existingIdentitySubscriptionId property: Existing 'Identity' subscription ID to be linked with this + * deployment when reusing instead of creating a new subscription. + * + * @return the existingIdentitySubscriptionId value. + */ + public String existingIdentitySubscriptionId() { + return this.existingIdentitySubscriptionId; + } + + /** + * Set the existingIdentitySubscriptionId property: Existing 'Identity' subscription ID to be linked with this + * deployment when reusing instead of creating a new subscription. + * + * @param existingIdentitySubscriptionId the existingIdentitySubscriptionId value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withExistingIdentitySubscriptionId(String existingIdentitySubscriptionId) { + this.existingIdentitySubscriptionId = existingIdentitySubscriptionId; + return this; + } + + /** + * Get the existingConnectivitySubscriptionId property: Existing 'Connectivity' subscription ID to be linked with + * this deployment when reusing instead of creating a new subscription. + * + * @return the existingConnectivitySubscriptionId value. + */ + public String existingConnectivitySubscriptionId() { + return this.existingConnectivitySubscriptionId; + } + + /** + * Set the existingConnectivitySubscriptionId property: Existing 'Connectivity' subscription ID to be linked with + * this deployment when reusing instead of creating a new subscription. + * + * @param existingConnectivitySubscriptionId the existingConnectivitySubscriptionId value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest + withExistingConnectivitySubscriptionId(String existingConnectivitySubscriptionId) { + this.existingConnectivitySubscriptionId = existingConnectivitySubscriptionId; + return this; + } + + /** + * Get the subscriptionBillingScope property: The complete resource ID of the billing scope linked to the EA, MCA, + * or MPA account where you want to create the subscription. + * + * @return the subscriptionBillingScope value. + */ + public String subscriptionBillingScope() { + return this.subscriptionBillingScope; + } + + /** + * Set the subscriptionBillingScope property: The complete resource ID of the billing scope linked to the EA, MCA, + * or MPA account where you want to create the subscription. + * + * @param subscriptionBillingScope the subscriptionBillingScope value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withSubscriptionBillingScope(String subscriptionBillingScope) { + this.subscriptionBillingScope = subscriptionBillingScope; + return this; + } + + /** + * Get the existingTopLevelMgParentId property: Optional parent for the management group hierarchy, serving as an + * intermediate root management group parent if specified. If left empty, the default will be to deploy under the + * tenant root management group. + * + * @return the existingTopLevelMgParentId value. + */ + public String existingTopLevelMgParentId() { + return this.existingTopLevelMgParentId; + } + + /** + * Set the existingTopLevelMgParentId property: Optional parent for the management group hierarchy, serving as an + * intermediate root management group parent if specified. If left empty, the default will be to deploy under the + * tenant root management group. + * + * @param existingTopLevelMgParentId the existingTopLevelMgParentId value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withExistingTopLevelMgParentId(String existingTopLevelMgParentId) { + this.existingTopLevelMgParentId = existingTopLevelMgParentId; + return this; + } + + /** + * Get the deploymentPrefix property: The prefix that will be added to all resources created by this deployment. Use + * between 2 and 5 characters, consisting only of letters, digits, '-', '.', or '_'. No other special characters are + * supported. + * + * @return the deploymentPrefix value. + */ + public String deploymentPrefix() { + return this.deploymentPrefix; + } + + /** + * Set the deploymentPrefix property: The prefix that will be added to all resources created by this deployment. Use + * between 2 and 5 characters, consisting only of letters, digits, '-', '.', or '_'. No other special characters are + * supported. + * + * @param deploymentPrefix the deploymentPrefix value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withDeploymentPrefix(String deploymentPrefix) { + this.deploymentPrefix = deploymentPrefix; + return this; + } + + /** + * Get the deploymentSuffix property: The optional suffix that will be appended to all resources created by this + * deployment, maximum 5 characters. + * + * @return the deploymentSuffix value. + */ + public String deploymentSuffix() { + return this.deploymentSuffix; + } + + /** + * Set the deploymentSuffix property: The optional suffix that will be appended to all resources created by this + * deployment, maximum 5 characters. + * + * @param deploymentSuffix the deploymentSuffix value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withDeploymentSuffix(String deploymentSuffix) { + this.deploymentSuffix = deploymentSuffix; + return this; + } + + /** + * Get the topLevelMgDisplayName property: The display name assigned to the top management group of the landing zone + * deployment hierarchy. It is recommended to use unique names for each landing zone deployment. + * + * @return the topLevelMgDisplayName value. + */ + public String topLevelMgDisplayName() { + return this.topLevelMgDisplayName; + } + + /** + * Set the topLevelMgDisplayName property: The display name assigned to the top management group of the landing zone + * deployment hierarchy. It is recommended to use unique names for each landing zone deployment. + * + * @param topLevelMgDisplayName the topLevelMgDisplayName value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withTopLevelMgDisplayName(String topLevelMgDisplayName) { + this.topLevelMgDisplayName = topLevelMgDisplayName; + return this; + } + + /** + * Get the deploymentLocation property: The Azure region where the landing zone will be deployed. All Azure regions + * are supported. + * + * @return the deploymentLocation value. + */ + public String deploymentLocation() { + return this.deploymentLocation; + } + + /** + * Set the deploymentLocation property: The Azure region where the landing zone will be deployed. All Azure regions + * are supported. + * + * @param deploymentLocation the deploymentLocation value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withDeploymentLocation(String deploymentLocation) { + this.deploymentLocation = deploymentLocation; + return this; + } + + /** + * Get the organization property: The name of the organization or agency for which the landing zone is being + * deployed. This is optional. + * + * @return the organization value. + */ + public String organization() { + return this.organization; + } + + /** + * Set the organization property: The name of the organization or agency for which the landing zone is being + * deployed. This is optional. + * + * @param organization the organization value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withOrganization(String organization) { + this.organization = organization; + return this; + } + + /** + * Get the environment property: The environment where the landing zone is being deployed, such as ppe, prod, test, + * etc. + * + * @return the environment value. + */ + public String environment() { + return this.environment; + } + + /** + * Set the environment property: The environment where the landing zone is being deployed, such as ppe, prod, test, + * etc. + * + * @param environment the environment value to set. + * @return the GenerateLandingZoneRequest object itself. + */ + public GenerateLandingZoneRequest withEnvironment(String environment) { + this.environment = environment; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (infrastructureAsCodeOutputOptions() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property infrastructureAsCodeOutputOptions in model GenerateLandingZoneRequest")); + } + if (deploymentPrefix() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentPrefix in model GenerateLandingZoneRequest")); + } + if (topLevelMgDisplayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property topLevelMgDisplayName in model GenerateLandingZoneRequest")); + } + if (deploymentLocation() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property deploymentLocation in model GenerateLandingZoneRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateLandingZoneRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("infrastructureAsCodeOutputOptions", + this.infrastructureAsCodeOutputOptions == null ? null : this.infrastructureAsCodeOutputOptions.toString()); + jsonWriter.writeStringField("deploymentPrefix", this.deploymentPrefix); + jsonWriter.writeStringField("topLevelMgDisplayName", this.topLevelMgDisplayName); + jsonWriter.writeStringField("deploymentLocation", this.deploymentLocation); + jsonWriter.writeStringField("existingManagementSubscriptionId", this.existingManagementSubscriptionId); + jsonWriter.writeStringField("existingIdentitySubscriptionId", this.existingIdentitySubscriptionId); + jsonWriter.writeStringField("existingConnectivitySubscriptionId", this.existingConnectivitySubscriptionId); + jsonWriter.writeStringField("subscriptionBillingScope", this.subscriptionBillingScope); + jsonWriter.writeStringField("existingTopLevelMgParentId", this.existingTopLevelMgParentId); + jsonWriter.writeStringField("deploymentSuffix", this.deploymentSuffix); + jsonWriter.writeStringField("organization", this.organization); + jsonWriter.writeStringField("environment", this.environment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateLandingZoneRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateLandingZoneRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateLandingZoneRequest. + */ + public static GenerateLandingZoneRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateLandingZoneRequest deserializedGenerateLandingZoneRequest = new GenerateLandingZoneRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("infrastructureAsCodeOutputOptions".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.infrastructureAsCodeOutputOptions + = InfrastructureAsCodeOutputOptions.fromString(reader.getString()); + } else if ("deploymentPrefix".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.deploymentPrefix = reader.getString(); + } else if ("topLevelMgDisplayName".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.topLevelMgDisplayName = reader.getString(); + } else if ("deploymentLocation".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.deploymentLocation = reader.getString(); + } else if ("existingManagementSubscriptionId".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.existingManagementSubscriptionId = reader.getString(); + } else if ("existingIdentitySubscriptionId".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.existingIdentitySubscriptionId = reader.getString(); + } else if ("existingConnectivitySubscriptionId".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.existingConnectivitySubscriptionId = reader.getString(); + } else if ("subscriptionBillingScope".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.subscriptionBillingScope = reader.getString(); + } else if ("existingTopLevelMgParentId".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.existingTopLevelMgParentId = reader.getString(); + } else if ("deploymentSuffix".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.deploymentSuffix = reader.getString(); + } else if ("organization".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.organization = reader.getString(); + } else if ("environment".equals(fieldName)) { + deserializedGenerateLandingZoneRequest.environment = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateLandingZoneRequest; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneResponse.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneResponse.java new file mode 100644 index 000000000000..e3a482f80d0b --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/GenerateLandingZoneResponse.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.sovereign.models; + +import com.azure.resourcemanager.sovereign.fluent.models.GenerateLandingZoneResponseInner; + +/** + * An immutable client-side representation of GenerateLandingZoneResponse. + */ +public interface GenerateLandingZoneResponse { + /** + * Gets the topLevelMgDisplayName property: The parent management group name of the landing zone deployment. + * + * @return the topLevelMgDisplayName value. + */ + String topLevelMgDisplayName(); + + /** + * Gets the landingZoneConfigurationName property: The name of the Landing zone configuration resource. + * + * @return the landingZoneConfigurationName value. + */ + String landingZoneConfigurationName(); + + /** + * Gets the generatedCodeUrl property: The url to access the generated code. + * + * @return the generatedCodeUrl value. + */ + String generatedCodeUrl(); + + /** + * Gets the storageAccountName property: The storage account name to access the generated code. + * + * @return the storageAccountName value. + */ + String storageAccountName(); + + /** + * Gets the containerName property: The storage account container to access the generated code. + * + * @return the containerName value. + */ + String containerName(); + + /** + * Gets the blobName property: The storage account blob name to access the generated code. + * + * @return the blobName value. + */ + String blobName(); + + /** + * Gets the generatedArmTemplate property: The generated code content in JSON string format. + * + * @return the generatedArmTemplate value. + */ + String generatedArmTemplate(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.GenerateLandingZoneResponseInner object. + * + * @return the inner object. + */ + GenerateLandingZoneResponseInner innerModel(); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/InfrastructureAsCodeOutputOptions.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/InfrastructureAsCodeOutputOptions.java new file mode 100644 index 000000000000..119d46187a09 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/InfrastructureAsCodeOutputOptions.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.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Output options for landing zone code generation. + */ +public final class InfrastructureAsCodeOutputOptions extends ExpandableStringEnum { + /** + * Static value Bicep for InfrastructureAsCodeOutputOptions. + */ + public static final InfrastructureAsCodeOutputOptions BICEP = fromString("Bicep"); + + /** + * Static value ARM for InfrastructureAsCodeOutputOptions. + */ + public static final InfrastructureAsCodeOutputOptions ARM = fromString("ARM"); + + /** + * Creates a new instance of InfrastructureAsCodeOutputOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public InfrastructureAsCodeOutputOptions() { + } + + /** + * Creates or finds a InfrastructureAsCodeOutputOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding InfrastructureAsCodeOutputOptions. + */ + public static InfrastructureAsCodeOutputOptions fromString(String name) { + return fromString(name, InfrastructureAsCodeOutputOptions.class); + } + + /** + * Gets known InfrastructureAsCodeOutputOptions values. + * + * @return known InfrastructureAsCodeOutputOptions values. + */ + public static Collection values() { + return values(InfrastructureAsCodeOutputOptions.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountOperations.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountOperations.java new file mode 100644 index 000000000000..38fc207548ca --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountOperations.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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 LandingZoneAccountOperations. + */ +public interface LandingZoneAccountOperations { + /** + * List the landing zone accounts within a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the landing zone accounts within a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List the landing zone accounts within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, + String landingZoneAccountName, Context context); + + /** + * Get a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account. + */ + LandingZoneAccountResource getByResourceGroup(String resourceGroupName, String landingZoneAccountName); + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String landingZoneAccountName); + + /** + * Deletes a landing zone account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String landingZoneAccountName, Context context); + + /** + * Get a landing zone account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response}. + */ + LandingZoneAccountResource getById(String id); + + /** + * Get a landing zone account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a landing zone account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a landing zone account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LandingZoneAccountResource resource. + * + * @param name resource name. + * @return the first stage of the new LandingZoneAccountResource definition. + */ + LandingZoneAccountResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResource.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResource.java new file mode 100644 index 000000000000..4f9a8ceb3d9a --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResource.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneAccountResourceInner; +import java.util.Map; + +/** + * An immutable client-side representation of LandingZoneAccountResource. + */ +public interface LandingZoneAccountResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LandingZoneAccountResourceProperties properties(); + + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.LandingZoneAccountResourceInner object. + * + * @return the inner object. + */ + LandingZoneAccountResourceInner innerModel(); + + /** + * The entirety of the LandingZoneAccountResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The LandingZoneAccountResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LandingZoneAccountResource definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the LandingZoneAccountResource 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 LandingZoneAccountResource 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 LandingZoneAccountResource 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, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + LandingZoneAccountResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LandingZoneAccountResource create(Context context); + } + + /** + * The stage of the LandingZoneAccountResource 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 LandingZoneAccountResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LandingZoneAccountResourceProperties properties); + } + + /** + * The stage of the LandingZoneAccountResource definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + } + + /** + * Begins update for the LandingZoneAccountResource resource. + * + * @return the stage of resource update. + */ + LandingZoneAccountResource.Update update(); + + /** + * The template for LandingZoneAccountResource update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LandingZoneAccountResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LandingZoneAccountResource apply(Context context); + } + + /** + * The LandingZoneAccountResource update stages. + */ + interface UpdateStages { + /** + * The stage of the LandingZoneAccountResource 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 LandingZoneAccountResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(LandingZoneAccountResourcePropertiesUpdate properties); + } + + /** + * The stage of the LandingZoneAccountResource update allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LandingZoneAccountResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LandingZoneAccountResource refresh(Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceListResult.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceListResult.java new file mode 100644 index 000000000000..b9b44d584b37 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceListResult.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneAccountResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LandingZoneAccountResource list operation. + */ +@Fluent +public final class LandingZoneAccountResourceListResult + implements JsonSerializable { + /* + * The LandingZoneAccountResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LandingZoneAccountResourceListResult class. + */ + public LandingZoneAccountResourceListResult() { + } + + /** + * Get the value property: The LandingZoneAccountResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LandingZoneAccountResource items on this page. + * + * @param value the value value to set. + * @return the LandingZoneAccountResourceListResult object itself. + */ + public LandingZoneAccountResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LandingZoneAccountResourceListResult object itself. + */ + public LandingZoneAccountResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LandingZoneAccountResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneAccountResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneAccountResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneAccountResourceListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneAccountResourceListResult. + */ + public static LandingZoneAccountResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneAccountResourceListResult deserializedLandingZoneAccountResourceListResult + = new LandingZoneAccountResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LandingZoneAccountResourceInner.fromJson(reader1)); + deserializedLandingZoneAccountResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLandingZoneAccountResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneAccountResourceListResult; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceProperties.java new file mode 100644 index 000000000000..5b63f78bf1a5 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of landing zone account resource type. + */ +@Fluent +public final class LandingZoneAccountResourceProperties + implements JsonSerializable { + /* + * The state that reflects the current stage in the creation, updating, or deletion process of the landing zone + * account. + */ + private ProvisioningState provisioningState; + + /* + * The storage account that will host the generated infrastructure as code (IaC) for a landing zone deployment. + */ + private String storageAccount; + + /** + * Creates an instance of LandingZoneAccountResourceProperties class. + */ + public LandingZoneAccountResourceProperties() { + } + + /** + * Get the provisioningState property: The state that reflects the current stage in the creation, updating, or + * deletion process of the landing zone account. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageAccount property: The storage account that will host the generated infrastructure as code (IaC) + * for a landing zone deployment. + * + * @return the storageAccount value. + */ + public String storageAccount() { + return this.storageAccount; + } + + /** + * Set the storageAccount property: The storage account that will host the generated infrastructure as code (IaC) + * for a landing zone deployment. + * + * @param storageAccount the storageAccount value to set. + * @return the LandingZoneAccountResourceProperties object itself. + */ + public LandingZoneAccountResourceProperties withStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageAccount() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property storageAccount in model LandingZoneAccountResourceProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneAccountResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageAccount", this.storageAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneAccountResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneAccountResourceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneAccountResourceProperties. + */ + public static LandingZoneAccountResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneAccountResourceProperties deserializedLandingZoneAccountResourceProperties + = new LandingZoneAccountResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccount".equals(fieldName)) { + deserializedLandingZoneAccountResourceProperties.storageAccount = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedLandingZoneAccountResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneAccountResourceProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourcePropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourcePropertiesUpdate.java new file mode 100644 index 000000000000..4e3fdcd99318 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourcePropertiesUpdate.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of landing zone account resource type. + */ +@Fluent +public final class LandingZoneAccountResourcePropertiesUpdate + implements JsonSerializable { + /* + * The storage account that will host the generated infrastructure as code (IaC) for a landing zone deployment. + */ + private String storageAccount; + + /** + * Creates an instance of LandingZoneAccountResourcePropertiesUpdate class. + */ + public LandingZoneAccountResourcePropertiesUpdate() { + } + + /** + * Get the storageAccount property: The storage account that will host the generated infrastructure as code (IaC) + * for a landing zone deployment. + * + * @return the storageAccount value. + */ + public String storageAccount() { + return this.storageAccount; + } + + /** + * Set the storageAccount property: The storage account that will host the generated infrastructure as code (IaC) + * for a landing zone deployment. + * + * @param storageAccount the storageAccount value to set. + * @return the LandingZoneAccountResourcePropertiesUpdate object itself. + */ + public LandingZoneAccountResourcePropertiesUpdate withStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageAccount", this.storageAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneAccountResourcePropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneAccountResourcePropertiesUpdate if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LandingZoneAccountResourcePropertiesUpdate. + */ + public static LandingZoneAccountResourcePropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneAccountResourcePropertiesUpdate deserializedLandingZoneAccountResourcePropertiesUpdate + = new LandingZoneAccountResourcePropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccount".equals(fieldName)) { + deserializedLandingZoneAccountResourcePropertiesUpdate.storageAccount = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneAccountResourcePropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceUpdate.java new file mode 100644 index 000000000000..99fb75ae2862 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneAccountResourceUpdate.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The Landing zone account resource type. A Landing zone account is the container for configuring, deploying and + * managing multiple landing zones. + */ +@Fluent +public final class LandingZoneAccountResourceUpdate extends AzureResourceManagerCommonTypesTrackedResourceUpdate { + /* + * The resource-specific properties for this resource. + */ + private LandingZoneAccountResourcePropertiesUpdate properties; + + /* + * The managed service identities assigned to this resource. + */ + private AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LandingZoneAccountResourceUpdate class. + */ + public LandingZoneAccountResourceUpdate() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LandingZoneAccountResourcePropertiesUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LandingZoneAccountResourceUpdate object itself. + */ + public LandingZoneAccountResourceUpdate withProperties(LandingZoneAccountResourcePropertiesUpdate properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the LandingZoneAccountResourceUpdate object itself. + */ + public LandingZoneAccountResourceUpdate + withIdentity(AzureResourceManagerCommonTypesManagedServiceIdentityUpdate identity) { + this.identity = identity; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public LandingZoneAccountResourceUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneAccountResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneAccountResourceUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneAccountResourceUpdate. + */ + public static LandingZoneAccountResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneAccountResourceUpdate deserializedLandingZoneAccountResourceUpdate + = new LandingZoneAccountResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLandingZoneAccountResourceUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLandingZoneAccountResourceUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLandingZoneAccountResourceUpdate.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedLandingZoneAccountResourceUpdate.withTags(tags); + } else if ("systemData".equals(fieldName)) { + deserializedLandingZoneAccountResourceUpdate.systemData = SystemData.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedLandingZoneAccountResourceUpdate.properties + = LandingZoneAccountResourcePropertiesUpdate.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedLandingZoneAccountResourceUpdate.identity + = AzureResourceManagerCommonTypesManagedServiceIdentityUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneAccountResourceUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationOperations.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationOperations.java new file mode 100644 index 000000000000..04d2f791397d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationOperations.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.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 LandingZoneConfigurationOperations. + */ +public interface LandingZoneConfigurationOperations { + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listBySubscription(String landingZoneAccountName); + + /** + * List the landing zone configurations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listBySubscription(String landingZoneAccountName, Context context); + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName); + + /** + * List the landing zone configurations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneConfigurationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context); + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, Context context); + + /** + * Get a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration. + */ + LandingZoneConfigurationResource get(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName); + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName); + + /** + * Delete a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneConfigurationName, + Context context); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + CreateLandingZoneConfigurationCopyResponse createCopy(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, CreateLandingZoneConfigurationCopyRequest body); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + CreateLandingZoneConfigurationCopyResponse createCopy(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, CreateLandingZoneConfigurationCopyRequest body, Context context); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + GenerateLandingZoneResponse generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + GenerateLandingZoneResponse generateLandingZone(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, GenerateLandingZoneRequest body, Context context); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + UpdateAuthoringStatusResponse updateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneConfigurationName The landing zone configuration name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + UpdateAuthoringStatusResponse updateAuthoringStatus(String resourceGroupName, String landingZoneAccountName, + String landingZoneConfigurationName, UpdateAuthoringStatusRequest body, Context context); + + /** + * Get a landing zone configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response}. + */ + LandingZoneConfigurationResource getById(String id); + + /** + * Get a landing zone configuration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone configuration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a landing zone configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a landing zone configuration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LandingZoneConfigurationResource resource. + * + * @param name resource name. + * @return the first stage of the new LandingZoneConfigurationResource definition. + */ + LandingZoneConfigurationResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResource.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResource.java new file mode 100644 index 000000000000..f1bd78ffdd12 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResource.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner; + +/** + * An immutable client-side representation of LandingZoneConfigurationResource. + */ +public interface LandingZoneConfigurationResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LandingZoneConfigurationResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner object. + * + * @return the inner object. + */ + LandingZoneConfigurationResourceInner innerModel(); + + /** + * The entirety of the LandingZoneConfigurationResource definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The LandingZoneConfigurationResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LandingZoneConfigurationResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the LandingZoneConfigurationResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, landingZoneAccountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @return the next definition stage. + */ + WithCreate withExistingLandingZoneAccount(String resourceGroupName, String landingZoneAccountName); + } + + /** + * The stage of the LandingZoneConfigurationResource 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. + */ + LandingZoneConfigurationResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LandingZoneConfigurationResource create(Context context); + } + + /** + * The stage of the LandingZoneConfigurationResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LandingZoneConfigurationResourceProperties properties); + } + } + + /** + * Begins update for the LandingZoneConfigurationResource resource. + * + * @return the stage of resource update. + */ + LandingZoneConfigurationResource.Update update(); + + /** + * The template for LandingZoneConfigurationResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LandingZoneConfigurationResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LandingZoneConfigurationResource apply(Context context); + } + + /** + * The LandingZoneConfigurationResource update stages. + */ + interface UpdateStages { + /** + * The stage of the LandingZoneConfigurationResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(LandingZoneConfigurationResourcePropertiesUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LandingZoneConfigurationResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LandingZoneConfigurationResource refresh(Context context); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + CreateLandingZoneConfigurationCopyResponse createCopy(CreateLandingZoneConfigurationCopyRequest body); + + /** + * Create a duplicate of the landing zone configuration. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of the create duplicate landing zone configuration. + */ + CreateLandingZoneConfigurationCopyResponse createCopy(CreateLandingZoneConfigurationCopyRequest body, + Context context); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + GenerateLandingZoneResponse generateLandingZone(GenerateLandingZoneRequest body); + + /** + * Generate infrastructure as code (IaC) for a landing zone deployment. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response payload for generating infrastructure-as-code for the landing zone. + */ + GenerateLandingZoneResponse generateLandingZone(GenerateLandingZoneRequest body, Context context); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + UpdateAuthoringStatusResponse updateAuthoringStatus(UpdateAuthoringStatusRequest body); + + /** + * Update the authoring status on a landing zone configuration. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response for authoring status update request. + */ + UpdateAuthoringStatusResponse updateAuthoringStatus(UpdateAuthoringStatusRequest body, Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceListResult.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceListResult.java new file mode 100644 index 000000000000..759950897cdb --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceListResult.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneConfigurationResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LandingZoneConfigurationResource list operation. + */ +@Fluent +public final class LandingZoneConfigurationResourceListResult + implements JsonSerializable { + /* + * The LandingZoneConfigurationResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LandingZoneConfigurationResourceListResult class. + */ + public LandingZoneConfigurationResourceListResult() { + } + + /** + * Get the value property: The LandingZoneConfigurationResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LandingZoneConfigurationResource items on this page. + * + * @param value the value value to set. + * @return the LandingZoneConfigurationResourceListResult object itself. + */ + public LandingZoneConfigurationResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LandingZoneConfigurationResourceListResult object itself. + */ + public LandingZoneConfigurationResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LandingZoneConfigurationResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneConfigurationResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneConfigurationResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneConfigurationResourceListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneConfigurationResourceListResult. + */ + public static LandingZoneConfigurationResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneConfigurationResourceListResult deserializedLandingZoneConfigurationResourceListResult + = new LandingZoneConfigurationResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LandingZoneConfigurationResourceInner.fromJson(reader1)); + deserializedLandingZoneConfigurationResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneConfigurationResourceListResult; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceProperties.java new file mode 100644 index 000000000000..ba66db7cc0be --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceProperties.java @@ -0,0 +1,1017 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties of landing zone configuration resource type. + */ +@Fluent +public final class LandingZoneConfigurationResourceProperties + implements JsonSerializable { + /* + * The state that reflects the current stage in the creation, updating, or deletion process of the landing zone + * configuration. + */ + private ProvisioningState provisioningState; + + /* + * The status that indicates the current phase of the configuration process for a deployment. + */ + private AuthoringStatus authoringStatus; + + /* + * Parameter used to deploy a DDoS protection plan: Select 'Yes' to enable deployment, 'No' to skip it, or + * 'Existing' to reuse an existing DDoS protection plan. + */ + private ResourceCreationOptions ddosProtectionCreationOption; + + /* + * The resource ID of the DDoS protection plan when reusing an existing one. + */ + private String existingDdosProtectionId; + + /* + * Parameter used to deploy a log analytics workspace: Select 'Yes' to enable deployment, 'No' to skip it, or + * 'Existing' to reuse an existing log analytics workspace. + */ + private ResourceCreationOptions logAnalyticsWorkspaceCreationOption; + + /* + * The resource ID of the log analytics workspace when reusing an existing one. + */ + private String existingLogAnalyticsWorkspaceId; + + /* + * Tags are key-value pairs that can be assigned to a resource to organize and manage it more effectively. Example: + * {'name': 'a tag name', 'value': 'a tag value'} + */ + private List tags; + + /* + * Parameter used for deploying a Firewall: Select 'No' to skip deployment, 'Standard' to deploy the Standard SKU, + * or 'Premium' to deploy the Premium SKU. + */ + private FirewallCreationOptions firewallCreationOption; + + /* + * The Firewall subnet address used for deploying a firewall. Specify the Firewall subnet using IPv4 CIDR notation. + */ + private String firewallSubnetCidrBlock; + + /* + * The gateway subnet address used for deploying a virtual network. Specify the subnet using IPv4 CIDR notation. + */ + private String gatewaySubnetCidrBlock; + + /* + * Parameter to define the retention period for logs, in days. The minimum duration is 30 days and the maximum is + * 730 days. + */ + private long logRetentionInDays; + + /* + * The Virtual Network address. Specify the address using IPv4 CIDR notation. + */ + private String hubNetworkCidrBlock; + + /* + * Parameter used to deploy a Bastion: Select 'Yes' to enable deployment, 'No' to skip it, or 'Existing' to reuse an + * existing Bastion. + */ + private ResourceCreationOptions azureBastionCreationOption; + + /* + * The resource ID of the Bastion when reusing an existing one. + */ + private String existingAzureBastionId; + + /* + * The Bastion subnet address. Specify the address using IPv4 CIDR notation. + */ + private String azureBastionSubnetCidrBlock; + + /* + * The child management groups of 'Landing Zones' management group and their assigned policies. + */ + private List landingZonesMgChildren; + + /* + * The assigned policies of the parent management group. + */ + private ManagementGroupProperties topLevelMgMetadata; + + /* + * The assigned policies of the 'Landing Zones' management group. + */ + private ManagementGroupProperties landingZonesMgMetadata; + + /* + * The assigned policies of the 'Platform' management group. + */ + private ManagementGroupProperties platformMgMetadata; + + /* + * The assigned policies of the 'Management' management group under 'Platform' management group. + */ + private ManagementGroupProperties platformManagementMgMetadata; + + /* + * The assigned policies of the 'Connectivity' management group under 'Platform' management group. + */ + private ManagementGroupProperties platformConnectivityMgMetadata; + + /* + * The assigned policies of the 'Identity' management group under 'Platform' management group. + */ + private ManagementGroupProperties platformIdentityMgMetadata; + + /* + * The assigned policies of the 'Decommissioned' management group and indicator to create it or not. + */ + private DecommissionedManagementGroupProperties decommissionedMgMetadata; + + /* + * The assigned policies of the 'Sandbox' management group and indicator to create it or not. + */ + private SandboxManagementGroupProperties sandboxMgMetadata; + + /* + * The managed identity to be assigned to this landing zone configuration. + */ + private ManagedIdentityProperties managedIdentity; + + /* + * The names of the 'Platform' child management groups and their assigned policies, excluding the default ones: + * 'Connectivity', 'Identity', and 'Management' + */ + private List platformMgChildren; + + /* + * The default naming convention applied to all resources for this landing zone configuration. Example - + * {DeploymentPrefix}-Contoso-{ResourceTypeAbbreviation}{DeploymentSuffix}-{Environment}-testing + */ + private String namingConventionFormula; + + /* + * The custom naming convention applied to specific resource types for this landing zone configuration, which + * overrides the default naming convention for those resource types. Example - 'customNamingConvention': + * [{'resourceType': 'azureFirewalls', 'formula': '{DeploymentPrefix}-afwl-{DeploymentSuffix}'}] + */ + private List customNamingConvention; + + /** + * Creates an instance of LandingZoneConfigurationResourceProperties class. + */ + public LandingZoneConfigurationResourceProperties() { + } + + /** + * Get the provisioningState property: The state that reflects the current stage in the creation, updating, or + * deletion process of the landing zone configuration. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the authoringStatus property: The status that indicates the current phase of the configuration process for a + * deployment. + * + * @return the authoringStatus value. + */ + public AuthoringStatus authoringStatus() { + return this.authoringStatus; + } + + /** + * Get the ddosProtectionCreationOption property: Parameter used to deploy a DDoS protection plan: Select 'Yes' to + * enable deployment, 'No' to skip it, or 'Existing' to reuse an existing DDoS protection plan. + * + * @return the ddosProtectionCreationOption value. + */ + public ResourceCreationOptions ddosProtectionCreationOption() { + return this.ddosProtectionCreationOption; + } + + /** + * Set the ddosProtectionCreationOption property: Parameter used to deploy a DDoS protection plan: Select 'Yes' to + * enable deployment, 'No' to skip it, or 'Existing' to reuse an existing DDoS protection plan. + * + * @param ddosProtectionCreationOption the ddosProtectionCreationOption value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withDdosProtectionCreationOption(ResourceCreationOptions ddosProtectionCreationOption) { + this.ddosProtectionCreationOption = ddosProtectionCreationOption; + return this; + } + + /** + * Get the existingDdosProtectionId property: The resource ID of the DDoS protection plan when reusing an existing + * one. + * + * @return the existingDdosProtectionId value. + */ + public String existingDdosProtectionId() { + return this.existingDdosProtectionId; + } + + /** + * Set the existingDdosProtectionId property: The resource ID of the DDoS protection plan when reusing an existing + * one. + * + * @param existingDdosProtectionId the existingDdosProtectionId value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withExistingDdosProtectionId(String existingDdosProtectionId) { + this.existingDdosProtectionId = existingDdosProtectionId; + return this; + } + + /** + * Get the logAnalyticsWorkspaceCreationOption property: Parameter used to deploy a log analytics workspace: Select + * 'Yes' to enable deployment, 'No' to skip it, or 'Existing' to reuse an existing log analytics workspace. + * + * @return the logAnalyticsWorkspaceCreationOption value. + */ + public ResourceCreationOptions logAnalyticsWorkspaceCreationOption() { + return this.logAnalyticsWorkspaceCreationOption; + } + + /** + * Set the logAnalyticsWorkspaceCreationOption property: Parameter used to deploy a log analytics workspace: Select + * 'Yes' to enable deployment, 'No' to skip it, or 'Existing' to reuse an existing log analytics workspace. + * + * @param logAnalyticsWorkspaceCreationOption the logAnalyticsWorkspaceCreationOption value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withLogAnalyticsWorkspaceCreationOption(ResourceCreationOptions logAnalyticsWorkspaceCreationOption) { + this.logAnalyticsWorkspaceCreationOption = logAnalyticsWorkspaceCreationOption; + return this; + } + + /** + * Get the existingLogAnalyticsWorkspaceId property: The resource ID of the log analytics workspace when reusing an + * existing one. + * + * @return the existingLogAnalyticsWorkspaceId value. + */ + public String existingLogAnalyticsWorkspaceId() { + return this.existingLogAnalyticsWorkspaceId; + } + + /** + * Set the existingLogAnalyticsWorkspaceId property: The resource ID of the log analytics workspace when reusing an + * existing one. + * + * @param existingLogAnalyticsWorkspaceId the existingLogAnalyticsWorkspaceId value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withExistingLogAnalyticsWorkspaceId(String existingLogAnalyticsWorkspaceId) { + this.existingLogAnalyticsWorkspaceId = existingLogAnalyticsWorkspaceId; + return this; + } + + /** + * Get the tags property: Tags are key-value pairs that can be assigned to a resource to organize and manage it more + * effectively. Example: {'name': 'a tag name', 'value': 'a tag value'}. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Tags are key-value pairs that can be assigned to a resource to organize and manage it more + * effectively. Example: {'name': 'a tag name', 'value': 'a tag value'}. + * + * @param tags the tags value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the firewallCreationOption property: Parameter used for deploying a Firewall: Select 'No' to skip deployment, + * 'Standard' to deploy the Standard SKU, or 'Premium' to deploy the Premium SKU. + * + * @return the firewallCreationOption value. + */ + public FirewallCreationOptions firewallCreationOption() { + return this.firewallCreationOption; + } + + /** + * Set the firewallCreationOption property: Parameter used for deploying a Firewall: Select 'No' to skip deployment, + * 'Standard' to deploy the Standard SKU, or 'Premium' to deploy the Premium SKU. + * + * @param firewallCreationOption the firewallCreationOption value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withFirewallCreationOption(FirewallCreationOptions firewallCreationOption) { + this.firewallCreationOption = firewallCreationOption; + return this; + } + + /** + * Get the firewallSubnetCidrBlock property: The Firewall subnet address used for deploying a firewall. Specify the + * Firewall subnet using IPv4 CIDR notation. + * + * @return the firewallSubnetCidrBlock value. + */ + public String firewallSubnetCidrBlock() { + return this.firewallSubnetCidrBlock; + } + + /** + * Set the firewallSubnetCidrBlock property: The Firewall subnet address used for deploying a firewall. Specify the + * Firewall subnet using IPv4 CIDR notation. + * + * @param firewallSubnetCidrBlock the firewallSubnetCidrBlock value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withFirewallSubnetCidrBlock(String firewallSubnetCidrBlock) { + this.firewallSubnetCidrBlock = firewallSubnetCidrBlock; + return this; + } + + /** + * Get the gatewaySubnetCidrBlock property: The gateway subnet address used for deploying a virtual network. Specify + * the subnet using IPv4 CIDR notation. + * + * @return the gatewaySubnetCidrBlock value. + */ + public String gatewaySubnetCidrBlock() { + return this.gatewaySubnetCidrBlock; + } + + /** + * Set the gatewaySubnetCidrBlock property: The gateway subnet address used for deploying a virtual network. Specify + * the subnet using IPv4 CIDR notation. + * + * @param gatewaySubnetCidrBlock the gatewaySubnetCidrBlock value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withGatewaySubnetCidrBlock(String gatewaySubnetCidrBlock) { + this.gatewaySubnetCidrBlock = gatewaySubnetCidrBlock; + return this; + } + + /** + * Get the logRetentionInDays property: Parameter to define the retention period for logs, in days. The minimum + * duration is 30 days and the maximum is 730 days. + * + * @return the logRetentionInDays value. + */ + public long logRetentionInDays() { + return this.logRetentionInDays; + } + + /** + * Set the logRetentionInDays property: Parameter to define the retention period for logs, in days. The minimum + * duration is 30 days and the maximum is 730 days. + * + * @param logRetentionInDays the logRetentionInDays value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withLogRetentionInDays(long logRetentionInDays) { + this.logRetentionInDays = logRetentionInDays; + return this; + } + + /** + * Get the hubNetworkCidrBlock property: The Virtual Network address. Specify the address using IPv4 CIDR notation. + * + * @return the hubNetworkCidrBlock value. + */ + public String hubNetworkCidrBlock() { + return this.hubNetworkCidrBlock; + } + + /** + * Set the hubNetworkCidrBlock property: The Virtual Network address. Specify the address using IPv4 CIDR notation. + * + * @param hubNetworkCidrBlock the hubNetworkCidrBlock value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withHubNetworkCidrBlock(String hubNetworkCidrBlock) { + this.hubNetworkCidrBlock = hubNetworkCidrBlock; + return this; + } + + /** + * Get the azureBastionCreationOption property: Parameter used to deploy a Bastion: Select 'Yes' to enable + * deployment, 'No' to skip it, or 'Existing' to reuse an existing Bastion. + * + * @return the azureBastionCreationOption value. + */ + public ResourceCreationOptions azureBastionCreationOption() { + return this.azureBastionCreationOption; + } + + /** + * Set the azureBastionCreationOption property: Parameter used to deploy a Bastion: Select 'Yes' to enable + * deployment, 'No' to skip it, or 'Existing' to reuse an existing Bastion. + * + * @param azureBastionCreationOption the azureBastionCreationOption value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withAzureBastionCreationOption(ResourceCreationOptions azureBastionCreationOption) { + this.azureBastionCreationOption = azureBastionCreationOption; + return this; + } + + /** + * Get the existingAzureBastionId property: The resource ID of the Bastion when reusing an existing one. + * + * @return the existingAzureBastionId value. + */ + public String existingAzureBastionId() { + return this.existingAzureBastionId; + } + + /** + * Set the existingAzureBastionId property: The resource ID of the Bastion when reusing an existing one. + * + * @param existingAzureBastionId the existingAzureBastionId value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withExistingAzureBastionId(String existingAzureBastionId) { + this.existingAzureBastionId = existingAzureBastionId; + return this; + } + + /** + * Get the azureBastionSubnetCidrBlock property: The Bastion subnet address. Specify the address using IPv4 CIDR + * notation. + * + * @return the azureBastionSubnetCidrBlock value. + */ + public String azureBastionSubnetCidrBlock() { + return this.azureBastionSubnetCidrBlock; + } + + /** + * Set the azureBastionSubnetCidrBlock property: The Bastion subnet address. Specify the address using IPv4 CIDR + * notation. + * + * @param azureBastionSubnetCidrBlock the azureBastionSubnetCidrBlock value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withAzureBastionSubnetCidrBlock(String azureBastionSubnetCidrBlock) { + this.azureBastionSubnetCidrBlock = azureBastionSubnetCidrBlock; + return this; + } + + /** + * Get the landingZonesMgChildren property: The child management groups of 'Landing Zones' management group and + * their assigned policies. + * + * @return the landingZonesMgChildren value. + */ + public List landingZonesMgChildren() { + return this.landingZonesMgChildren; + } + + /** + * Set the landingZonesMgChildren property: The child management groups of 'Landing Zones' management group and + * their assigned policies. + * + * @param landingZonesMgChildren the landingZonesMgChildren value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withLandingZonesMgChildren(List landingZonesMgChildren) { + this.landingZonesMgChildren = landingZonesMgChildren; + return this; + } + + /** + * Get the topLevelMgMetadata property: The assigned policies of the parent management group. + * + * @return the topLevelMgMetadata value. + */ + public ManagementGroupProperties topLevelMgMetadata() { + return this.topLevelMgMetadata; + } + + /** + * Set the topLevelMgMetadata property: The assigned policies of the parent management group. + * + * @param topLevelMgMetadata the topLevelMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withTopLevelMgMetadata(ManagementGroupProperties topLevelMgMetadata) { + this.topLevelMgMetadata = topLevelMgMetadata; + return this; + } + + /** + * Get the landingZonesMgMetadata property: The assigned policies of the 'Landing Zones' management group. + * + * @return the landingZonesMgMetadata value. + */ + public ManagementGroupProperties landingZonesMgMetadata() { + return this.landingZonesMgMetadata; + } + + /** + * Set the landingZonesMgMetadata property: The assigned policies of the 'Landing Zones' management group. + * + * @param landingZonesMgMetadata the landingZonesMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withLandingZonesMgMetadata(ManagementGroupProperties landingZonesMgMetadata) { + this.landingZonesMgMetadata = landingZonesMgMetadata; + return this; + } + + /** + * Get the platformMgMetadata property: The assigned policies of the 'Platform' management group. + * + * @return the platformMgMetadata value. + */ + public ManagementGroupProperties platformMgMetadata() { + return this.platformMgMetadata; + } + + /** + * Set the platformMgMetadata property: The assigned policies of the 'Platform' management group. + * + * @param platformMgMetadata the platformMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withPlatformMgMetadata(ManagementGroupProperties platformMgMetadata) { + this.platformMgMetadata = platformMgMetadata; + return this; + } + + /** + * Get the platformManagementMgMetadata property: The assigned policies of the 'Management' management group under + * 'Platform' management group. + * + * @return the platformManagementMgMetadata value. + */ + public ManagementGroupProperties platformManagementMgMetadata() { + return this.platformManagementMgMetadata; + } + + /** + * Set the platformManagementMgMetadata property: The assigned policies of the 'Management' management group under + * 'Platform' management group. + * + * @param platformManagementMgMetadata the platformManagementMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withPlatformManagementMgMetadata(ManagementGroupProperties platformManagementMgMetadata) { + this.platformManagementMgMetadata = platformManagementMgMetadata; + return this; + } + + /** + * Get the platformConnectivityMgMetadata property: The assigned policies of the 'Connectivity' management group + * under 'Platform' management group. + * + * @return the platformConnectivityMgMetadata value. + */ + public ManagementGroupProperties platformConnectivityMgMetadata() { + return this.platformConnectivityMgMetadata; + } + + /** + * Set the platformConnectivityMgMetadata property: The assigned policies of the 'Connectivity' management group + * under 'Platform' management group. + * + * @param platformConnectivityMgMetadata the platformConnectivityMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withPlatformConnectivityMgMetadata(ManagementGroupProperties platformConnectivityMgMetadata) { + this.platformConnectivityMgMetadata = platformConnectivityMgMetadata; + return this; + } + + /** + * Get the platformIdentityMgMetadata property: The assigned policies of the 'Identity' management group under + * 'Platform' management group. + * + * @return the platformIdentityMgMetadata value. + */ + public ManagementGroupProperties platformIdentityMgMetadata() { + return this.platformIdentityMgMetadata; + } + + /** + * Set the platformIdentityMgMetadata property: The assigned policies of the 'Identity' management group under + * 'Platform' management group. + * + * @param platformIdentityMgMetadata the platformIdentityMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withPlatformIdentityMgMetadata(ManagementGroupProperties platformIdentityMgMetadata) { + this.platformIdentityMgMetadata = platformIdentityMgMetadata; + return this; + } + + /** + * Get the decommissionedMgMetadata property: The assigned policies of the 'Decommissioned' management group and + * indicator to create it or not. + * + * @return the decommissionedMgMetadata value. + */ + public DecommissionedManagementGroupProperties decommissionedMgMetadata() { + return this.decommissionedMgMetadata; + } + + /** + * Set the decommissionedMgMetadata property: The assigned policies of the 'Decommissioned' management group and + * indicator to create it or not. + * + * @param decommissionedMgMetadata the decommissionedMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withDecommissionedMgMetadata(DecommissionedManagementGroupProperties decommissionedMgMetadata) { + this.decommissionedMgMetadata = decommissionedMgMetadata; + return this; + } + + /** + * Get the sandboxMgMetadata property: The assigned policies of the 'Sandbox' management group and indicator to + * create it or not. + * + * @return the sandboxMgMetadata value. + */ + public SandboxManagementGroupProperties sandboxMgMetadata() { + return this.sandboxMgMetadata; + } + + /** + * Set the sandboxMgMetadata property: The assigned policies of the 'Sandbox' management group and indicator to + * create it or not. + * + * @param sandboxMgMetadata the sandboxMgMetadata value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withSandboxMgMetadata(SandboxManagementGroupProperties sandboxMgMetadata) { + this.sandboxMgMetadata = sandboxMgMetadata; + return this; + } + + /** + * Get the managedIdentity property: The managed identity to be assigned to this landing zone configuration. + * + * @return the managedIdentity value. + */ + public ManagedIdentityProperties managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: The managed identity to be assigned to this landing zone configuration. + * + * @param managedIdentity the managedIdentity value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withManagedIdentity(ManagedIdentityProperties managedIdentity) { + this.managedIdentity = managedIdentity; + return this; + } + + /** + * Get the platformMgChildren property: The names of the 'Platform' child management groups and their assigned + * policies, excluding the default ones: 'Connectivity', 'Identity', and 'Management'. + * + * @return the platformMgChildren value. + */ + public List platformMgChildren() { + return this.platformMgChildren; + } + + /** + * Set the platformMgChildren property: The names of the 'Platform' child management groups and their assigned + * policies, excluding the default ones: 'Connectivity', 'Identity', and 'Management'. + * + * @param platformMgChildren the platformMgChildren value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withPlatformMgChildren(List platformMgChildren) { + this.platformMgChildren = platformMgChildren; + return this; + } + + /** + * Get the namingConventionFormula property: The default naming convention applied to all resources for this landing + * zone configuration. Example - + * {DeploymentPrefix}-Contoso-{ResourceTypeAbbreviation}{DeploymentSuffix}-{Environment}-testing. + * + * @return the namingConventionFormula value. + */ + public String namingConventionFormula() { + return this.namingConventionFormula; + } + + /** + * Set the namingConventionFormula property: The default naming convention applied to all resources for this landing + * zone configuration. Example - + * {DeploymentPrefix}-Contoso-{ResourceTypeAbbreviation}{DeploymentSuffix}-{Environment}-testing. + * + * @param namingConventionFormula the namingConventionFormula value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties withNamingConventionFormula(String namingConventionFormula) { + this.namingConventionFormula = namingConventionFormula; + return this; + } + + /** + * Get the customNamingConvention property: The custom naming convention applied to specific resource types for this + * landing zone configuration, which overrides the default naming convention for those resource types. Example - + * 'customNamingConvention': [{'resourceType': 'azureFirewalls', 'formula': + * '{DeploymentPrefix}-afwl-{DeploymentSuffix}'}]. + * + * @return the customNamingConvention value. + */ + public List customNamingConvention() { + return this.customNamingConvention; + } + + /** + * Set the customNamingConvention property: The custom naming convention applied to specific resource types for this + * landing zone configuration, which overrides the default naming convention for those resource types. Example - + * 'customNamingConvention': [{'resourceType': 'azureFirewalls', 'formula': + * '{DeploymentPrefix}-afwl-{DeploymentSuffix}'}]. + * + * @param customNamingConvention the customNamingConvention value to set. + * @return the LandingZoneConfigurationResourceProperties object itself. + */ + public LandingZoneConfigurationResourceProperties + withCustomNamingConvention(List customNamingConvention) { + this.customNamingConvention = customNamingConvention; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ddosProtectionCreationOption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ddosProtectionCreationOption in model LandingZoneConfigurationResourceProperties")); + } + if (logAnalyticsWorkspaceCreationOption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property logAnalyticsWorkspaceCreationOption in model LandingZoneConfigurationResourceProperties")); + } + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (firewallCreationOption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property firewallCreationOption in model LandingZoneConfigurationResourceProperties")); + } + if (gatewaySubnetCidrBlock() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property gatewaySubnetCidrBlock in model LandingZoneConfigurationResourceProperties")); + } + if (hubNetworkCidrBlock() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hubNetworkCidrBlock in model LandingZoneConfigurationResourceProperties")); + } + if (azureBastionCreationOption() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property azureBastionCreationOption in model LandingZoneConfigurationResourceProperties")); + } + if (landingZonesMgChildren() != null) { + landingZonesMgChildren().forEach(e -> e.validate()); + } + if (topLevelMgMetadata() != null) { + topLevelMgMetadata().validate(); + } + if (landingZonesMgMetadata() != null) { + landingZonesMgMetadata().validate(); + } + if (platformMgMetadata() != null) { + platformMgMetadata().validate(); + } + if (platformManagementMgMetadata() != null) { + platformManagementMgMetadata().validate(); + } + if (platformConnectivityMgMetadata() != null) { + platformConnectivityMgMetadata().validate(); + } + if (platformIdentityMgMetadata() != null) { + platformIdentityMgMetadata().validate(); + } + if (decommissionedMgMetadata() != null) { + decommissionedMgMetadata().validate(); + } + if (sandboxMgMetadata() != null) { + sandboxMgMetadata().validate(); + } + if (managedIdentity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property managedIdentity in model LandingZoneConfigurationResourceProperties")); + } else { + managedIdentity().validate(); + } + if (platformMgChildren() != null) { + platformMgChildren().forEach(e -> e.validate()); + } + if (customNamingConvention() != null) { + customNamingConvention().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneConfigurationResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ddosProtectionCreationOption", + this.ddosProtectionCreationOption == null ? null : this.ddosProtectionCreationOption.toString()); + jsonWriter.writeStringField("logAnalyticsWorkspaceCreationOption", + this.logAnalyticsWorkspaceCreationOption == null + ? null + : this.logAnalyticsWorkspaceCreationOption.toString()); + jsonWriter.writeStringField("firewallCreationOption", + this.firewallCreationOption == null ? null : this.firewallCreationOption.toString()); + jsonWriter.writeStringField("gatewaySubnetCidrBlock", this.gatewaySubnetCidrBlock); + jsonWriter.writeLongField("logRetentionInDays", this.logRetentionInDays); + jsonWriter.writeStringField("hubNetworkCidrBlock", this.hubNetworkCidrBlock); + jsonWriter.writeStringField("azureBastionCreationOption", + this.azureBastionCreationOption == null ? null : this.azureBastionCreationOption.toString()); + jsonWriter.writeJsonField("managedIdentity", this.managedIdentity); + jsonWriter.writeStringField("existingDdosProtectionId", this.existingDdosProtectionId); + jsonWriter.writeStringField("existingLogAnalyticsWorkspaceId", this.existingLogAnalyticsWorkspaceId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firewallSubnetCidrBlock", this.firewallSubnetCidrBlock); + jsonWriter.writeStringField("existingAzureBastionId", this.existingAzureBastionId); + jsonWriter.writeStringField("azureBastionSubnetCidrBlock", this.azureBastionSubnetCidrBlock); + jsonWriter.writeArrayField("landingZonesMgChildren", this.landingZonesMgChildren, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("topLevelMgMetadata", this.topLevelMgMetadata); + jsonWriter.writeJsonField("landingZonesMgMetadata", this.landingZonesMgMetadata); + jsonWriter.writeJsonField("platformMgMetadata", this.platformMgMetadata); + jsonWriter.writeJsonField("platformManagementMgMetadata", this.platformManagementMgMetadata); + jsonWriter.writeJsonField("platformConnectivityMgMetadata", this.platformConnectivityMgMetadata); + jsonWriter.writeJsonField("platformIdentityMgMetadata", this.platformIdentityMgMetadata); + jsonWriter.writeJsonField("decommissionedMgMetadata", this.decommissionedMgMetadata); + jsonWriter.writeJsonField("sandboxMgMetadata", this.sandboxMgMetadata); + jsonWriter.writeArrayField("platformMgChildren", this.platformMgChildren, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("namingConventionFormula", this.namingConventionFormula); + jsonWriter.writeArrayField("customNamingConvention", this.customNamingConvention, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneConfigurationResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneConfigurationResourceProperties if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneConfigurationResourceProperties. + */ + public static LandingZoneConfigurationResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneConfigurationResourceProperties deserializedLandingZoneConfigurationResourceProperties + = new LandingZoneConfigurationResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ddosProtectionCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.ddosProtectionCreationOption + = ResourceCreationOptions.fromString(reader.getString()); + } else if ("logAnalyticsWorkspaceCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.logAnalyticsWorkspaceCreationOption + = ResourceCreationOptions.fromString(reader.getString()); + } else if ("firewallCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.firewallCreationOption + = FirewallCreationOptions.fromString(reader.getString()); + } else if ("gatewaySubnetCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.gatewaySubnetCidrBlock = reader.getString(); + } else if ("logRetentionInDays".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.logRetentionInDays = reader.getLong(); + } else if ("hubNetworkCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.hubNetworkCidrBlock = reader.getString(); + } else if ("azureBastionCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.azureBastionCreationOption + = ResourceCreationOptions.fromString(reader.getString()); + } else if ("managedIdentity".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.managedIdentity + = ManagedIdentityProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("authoringStatus".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.authoringStatus + = AuthoringStatus.fromString(reader.getString()); + } else if ("existingDdosProtectionId".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.existingDdosProtectionId + = reader.getString(); + } else if ("existingLogAnalyticsWorkspaceId".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.existingLogAnalyticsWorkspaceId + = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> Tags.fromJson(reader1)); + deserializedLandingZoneConfigurationResourceProperties.tags = tags; + } else if ("firewallSubnetCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.firewallSubnetCidrBlock = reader.getString(); + } else if ("existingAzureBastionId".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.existingAzureBastionId = reader.getString(); + } else if ("azureBastionSubnetCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.azureBastionSubnetCidrBlock + = reader.getString(); + } else if ("landingZonesMgChildren".equals(fieldName)) { + List landingZonesMgChildren + = reader.readArray(reader1 -> LandingZoneManagementGroupProperties.fromJson(reader1)); + deserializedLandingZoneConfigurationResourceProperties.landingZonesMgChildren + = landingZonesMgChildren; + } else if ("topLevelMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.topLevelMgMetadata + = ManagementGroupProperties.fromJson(reader); + } else if ("landingZonesMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.landingZonesMgMetadata + = ManagementGroupProperties.fromJson(reader); + } else if ("platformMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.platformMgMetadata + = ManagementGroupProperties.fromJson(reader); + } else if ("platformManagementMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.platformManagementMgMetadata + = ManagementGroupProperties.fromJson(reader); + } else if ("platformConnectivityMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.platformConnectivityMgMetadata + = ManagementGroupProperties.fromJson(reader); + } else if ("platformIdentityMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.platformIdentityMgMetadata + = ManagementGroupProperties.fromJson(reader); + } else if ("decommissionedMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.decommissionedMgMetadata + = DecommissionedManagementGroupProperties.fromJson(reader); + } else if ("sandboxMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.sandboxMgMetadata + = SandboxManagementGroupProperties.fromJson(reader); + } else if ("platformMgChildren".equals(fieldName)) { + List platformMgChildren + = reader.readArray(reader1 -> PlatformManagementGroupProperties.fromJson(reader1)); + deserializedLandingZoneConfigurationResourceProperties.platformMgChildren = platformMgChildren; + } else if ("namingConventionFormula".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceProperties.namingConventionFormula = reader.getString(); + } else if ("customNamingConvention".equals(fieldName)) { + List customNamingConvention + = reader.readArray(reader1 -> CustomNamingConvention.fromJson(reader1)); + deserializedLandingZoneConfigurationResourceProperties.customNamingConvention + = customNamingConvention; + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneConfigurationResourceProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourcePropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourcePropertiesUpdate.java new file mode 100644 index 000000000000..a159534ef026 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourcePropertiesUpdate.java @@ -0,0 +1,953 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties of landing zone configuration resource type. + */ +@Fluent +public final class LandingZoneConfigurationResourcePropertiesUpdate + implements JsonSerializable { + /* + * Parameter used to deploy a DDoS protection plan: Select 'Yes' to enable deployment, 'No' to skip it, or + * 'Existing' to reuse an existing DDoS protection plan. + */ + private ResourceCreationOptions ddosProtectionCreationOption; + + /* + * The resource ID of the DDoS protection plan when reusing an existing one. + */ + private String existingDdosProtectionId; + + /* + * Parameter used to deploy a log analytics workspace: Select 'Yes' to enable deployment, 'No' to skip it, or + * 'Existing' to reuse an existing log analytics workspace. + */ + private ResourceCreationOptions logAnalyticsWorkspaceCreationOption; + + /* + * The resource ID of the log analytics workspace when reusing an existing one. + */ + private String existingLogAnalyticsWorkspaceId; + + /* + * Tags are key-value pairs that can be assigned to a resource to organize and manage it more effectively. Example: + * {'name': 'a tag name', 'value': 'a tag value'} + */ + private List tags; + + /* + * Parameter used for deploying a Firewall: Select 'No' to skip deployment, 'Standard' to deploy the Standard SKU, + * or 'Premium' to deploy the Premium SKU. + */ + private FirewallCreationOptions firewallCreationOption; + + /* + * The Firewall subnet address used for deploying a firewall. Specify the Firewall subnet using IPv4 CIDR notation. + */ + private String firewallSubnetCidrBlock; + + /* + * The gateway subnet address used for deploying a virtual network. Specify the subnet using IPv4 CIDR notation. + */ + private String gatewaySubnetCidrBlock; + + /* + * Parameter to define the retention period for logs, in days. The minimum duration is 30 days and the maximum is + * 730 days. + */ + private Long logRetentionInDays; + + /* + * The Virtual Network address. Specify the address using IPv4 CIDR notation. + */ + private String hubNetworkCidrBlock; + + /* + * Parameter used to deploy a Bastion: Select 'Yes' to enable deployment, 'No' to skip it, or 'Existing' to reuse an + * existing Bastion. + */ + private ResourceCreationOptions azureBastionCreationOption; + + /* + * The resource ID of the Bastion when reusing an existing one. + */ + private String existingAzureBastionId; + + /* + * The Bastion subnet address. Specify the address using IPv4 CIDR notation. + */ + private String azureBastionSubnetCidrBlock; + + /* + * The child management groups of 'Landing Zones' management group and their assigned policies. + */ + private List landingZonesMgChildren; + + /* + * The assigned policies of the parent management group. + */ + private ManagementGroupPropertiesUpdate topLevelMgMetadata; + + /* + * The assigned policies of the 'Landing Zones' management group. + */ + private ManagementGroupPropertiesUpdate landingZonesMgMetadata; + + /* + * The assigned policies of the 'Platform' management group. + */ + private ManagementGroupPropertiesUpdate platformMgMetadata; + + /* + * The assigned policies of the 'Management' management group under 'Platform' management group. + */ + private ManagementGroupPropertiesUpdate platformManagementMgMetadata; + + /* + * The assigned policies of the 'Connectivity' management group under 'Platform' management group. + */ + private ManagementGroupPropertiesUpdate platformConnectivityMgMetadata; + + /* + * The assigned policies of the 'Identity' management group under 'Platform' management group. + */ + private ManagementGroupPropertiesUpdate platformIdentityMgMetadata; + + /* + * The assigned policies of the 'Decommissioned' management group and indicator to create it or not. + */ + private DecommissionedManagementGroupPropertiesUpdate decommissionedMgMetadata; + + /* + * The assigned policies of the 'Sandbox' management group and indicator to create it or not. + */ + private SandboxManagementGroupPropertiesUpdate sandboxMgMetadata; + + /* + * The managed identity to be assigned to this landing zone configuration. + */ + private ManagedIdentityPropertiesUpdate managedIdentity; + + /* + * The names of the 'Platform' child management groups and their assigned policies, excluding the default ones: + * 'Connectivity', 'Identity', and 'Management' + */ + private List platformMgChildren; + + /* + * The default naming convention applied to all resources for this landing zone configuration. Example - + * {DeploymentPrefix}-Contoso-{ResourceTypeAbbreviation}{DeploymentSuffix}-{Environment}-testing + */ + private String namingConventionFormula; + + /* + * The custom naming convention applied to specific resource types for this landing zone configuration, which + * overrides the default naming convention for those resource types. Example - 'customNamingConvention': + * [{'resourceType': 'azureFirewalls', 'formula': '{DeploymentPrefix}-afwl-{DeploymentSuffix}'}] + */ + private List customNamingConvention; + + /** + * Creates an instance of LandingZoneConfigurationResourcePropertiesUpdate class. + */ + public LandingZoneConfigurationResourcePropertiesUpdate() { + } + + /** + * Get the ddosProtectionCreationOption property: Parameter used to deploy a DDoS protection plan: Select 'Yes' to + * enable deployment, 'No' to skip it, or 'Existing' to reuse an existing DDoS protection plan. + * + * @return the ddosProtectionCreationOption value. + */ + public ResourceCreationOptions ddosProtectionCreationOption() { + return this.ddosProtectionCreationOption; + } + + /** + * Set the ddosProtectionCreationOption property: Parameter used to deploy a DDoS protection plan: Select 'Yes' to + * enable deployment, 'No' to skip it, or 'Existing' to reuse an existing DDoS protection plan. + * + * @param ddosProtectionCreationOption the ddosProtectionCreationOption value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withDdosProtectionCreationOption(ResourceCreationOptions ddosProtectionCreationOption) { + this.ddosProtectionCreationOption = ddosProtectionCreationOption; + return this; + } + + /** + * Get the existingDdosProtectionId property: The resource ID of the DDoS protection plan when reusing an existing + * one. + * + * @return the existingDdosProtectionId value. + */ + public String existingDdosProtectionId() { + return this.existingDdosProtectionId; + } + + /** + * Set the existingDdosProtectionId property: The resource ID of the DDoS protection plan when reusing an existing + * one. + * + * @param existingDdosProtectionId the existingDdosProtectionId value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withExistingDdosProtectionId(String existingDdosProtectionId) { + this.existingDdosProtectionId = existingDdosProtectionId; + return this; + } + + /** + * Get the logAnalyticsWorkspaceCreationOption property: Parameter used to deploy a log analytics workspace: Select + * 'Yes' to enable deployment, 'No' to skip it, or 'Existing' to reuse an existing log analytics workspace. + * + * @return the logAnalyticsWorkspaceCreationOption value. + */ + public ResourceCreationOptions logAnalyticsWorkspaceCreationOption() { + return this.logAnalyticsWorkspaceCreationOption; + } + + /** + * Set the logAnalyticsWorkspaceCreationOption property: Parameter used to deploy a log analytics workspace: Select + * 'Yes' to enable deployment, 'No' to skip it, or 'Existing' to reuse an existing log analytics workspace. + * + * @param logAnalyticsWorkspaceCreationOption the logAnalyticsWorkspaceCreationOption value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withLogAnalyticsWorkspaceCreationOption(ResourceCreationOptions logAnalyticsWorkspaceCreationOption) { + this.logAnalyticsWorkspaceCreationOption = logAnalyticsWorkspaceCreationOption; + return this; + } + + /** + * Get the existingLogAnalyticsWorkspaceId property: The resource ID of the log analytics workspace when reusing an + * existing one. + * + * @return the existingLogAnalyticsWorkspaceId value. + */ + public String existingLogAnalyticsWorkspaceId() { + return this.existingLogAnalyticsWorkspaceId; + } + + /** + * Set the existingLogAnalyticsWorkspaceId property: The resource ID of the log analytics workspace when reusing an + * existing one. + * + * @param existingLogAnalyticsWorkspaceId the existingLogAnalyticsWorkspaceId value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withExistingLogAnalyticsWorkspaceId(String existingLogAnalyticsWorkspaceId) { + this.existingLogAnalyticsWorkspaceId = existingLogAnalyticsWorkspaceId; + return this; + } + + /** + * Get the tags property: Tags are key-value pairs that can be assigned to a resource to organize and manage it more + * effectively. Example: {'name': 'a tag name', 'value': 'a tag value'}. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Tags are key-value pairs that can be assigned to a resource to organize and manage it more + * effectively. Example: {'name': 'a tag name', 'value': 'a tag value'}. + * + * @param tags the tags value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate withTags(List tags) { + this.tags = tags; + return this; + } + + /** + * Get the firewallCreationOption property: Parameter used for deploying a Firewall: Select 'No' to skip deployment, + * 'Standard' to deploy the Standard SKU, or 'Premium' to deploy the Premium SKU. + * + * @return the firewallCreationOption value. + */ + public FirewallCreationOptions firewallCreationOption() { + return this.firewallCreationOption; + } + + /** + * Set the firewallCreationOption property: Parameter used for deploying a Firewall: Select 'No' to skip deployment, + * 'Standard' to deploy the Standard SKU, or 'Premium' to deploy the Premium SKU. + * + * @param firewallCreationOption the firewallCreationOption value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withFirewallCreationOption(FirewallCreationOptions firewallCreationOption) { + this.firewallCreationOption = firewallCreationOption; + return this; + } + + /** + * Get the firewallSubnetCidrBlock property: The Firewall subnet address used for deploying a firewall. Specify the + * Firewall subnet using IPv4 CIDR notation. + * + * @return the firewallSubnetCidrBlock value. + */ + public String firewallSubnetCidrBlock() { + return this.firewallSubnetCidrBlock; + } + + /** + * Set the firewallSubnetCidrBlock property: The Firewall subnet address used for deploying a firewall. Specify the + * Firewall subnet using IPv4 CIDR notation. + * + * @param firewallSubnetCidrBlock the firewallSubnetCidrBlock value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withFirewallSubnetCidrBlock(String firewallSubnetCidrBlock) { + this.firewallSubnetCidrBlock = firewallSubnetCidrBlock; + return this; + } + + /** + * Get the gatewaySubnetCidrBlock property: The gateway subnet address used for deploying a virtual network. Specify + * the subnet using IPv4 CIDR notation. + * + * @return the gatewaySubnetCidrBlock value. + */ + public String gatewaySubnetCidrBlock() { + return this.gatewaySubnetCidrBlock; + } + + /** + * Set the gatewaySubnetCidrBlock property: The gateway subnet address used for deploying a virtual network. Specify + * the subnet using IPv4 CIDR notation. + * + * @param gatewaySubnetCidrBlock the gatewaySubnetCidrBlock value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate withGatewaySubnetCidrBlock(String gatewaySubnetCidrBlock) { + this.gatewaySubnetCidrBlock = gatewaySubnetCidrBlock; + return this; + } + + /** + * Get the logRetentionInDays property: Parameter to define the retention period for logs, in days. The minimum + * duration is 30 days and the maximum is 730 days. + * + * @return the logRetentionInDays value. + */ + public Long logRetentionInDays() { + return this.logRetentionInDays; + } + + /** + * Set the logRetentionInDays property: Parameter to define the retention period for logs, in days. The minimum + * duration is 30 days and the maximum is 730 days. + * + * @param logRetentionInDays the logRetentionInDays value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate withLogRetentionInDays(Long logRetentionInDays) { + this.logRetentionInDays = logRetentionInDays; + return this; + } + + /** + * Get the hubNetworkCidrBlock property: The Virtual Network address. Specify the address using IPv4 CIDR notation. + * + * @return the hubNetworkCidrBlock value. + */ + public String hubNetworkCidrBlock() { + return this.hubNetworkCidrBlock; + } + + /** + * Set the hubNetworkCidrBlock property: The Virtual Network address. Specify the address using IPv4 CIDR notation. + * + * @param hubNetworkCidrBlock the hubNetworkCidrBlock value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate withHubNetworkCidrBlock(String hubNetworkCidrBlock) { + this.hubNetworkCidrBlock = hubNetworkCidrBlock; + return this; + } + + /** + * Get the azureBastionCreationOption property: Parameter used to deploy a Bastion: Select 'Yes' to enable + * deployment, 'No' to skip it, or 'Existing' to reuse an existing Bastion. + * + * @return the azureBastionCreationOption value. + */ + public ResourceCreationOptions azureBastionCreationOption() { + return this.azureBastionCreationOption; + } + + /** + * Set the azureBastionCreationOption property: Parameter used to deploy a Bastion: Select 'Yes' to enable + * deployment, 'No' to skip it, or 'Existing' to reuse an existing Bastion. + * + * @param azureBastionCreationOption the azureBastionCreationOption value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withAzureBastionCreationOption(ResourceCreationOptions azureBastionCreationOption) { + this.azureBastionCreationOption = azureBastionCreationOption; + return this; + } + + /** + * Get the existingAzureBastionId property: The resource ID of the Bastion when reusing an existing one. + * + * @return the existingAzureBastionId value. + */ + public String existingAzureBastionId() { + return this.existingAzureBastionId; + } + + /** + * Set the existingAzureBastionId property: The resource ID of the Bastion when reusing an existing one. + * + * @param existingAzureBastionId the existingAzureBastionId value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate withExistingAzureBastionId(String existingAzureBastionId) { + this.existingAzureBastionId = existingAzureBastionId; + return this; + } + + /** + * Get the azureBastionSubnetCidrBlock property: The Bastion subnet address. Specify the address using IPv4 CIDR + * notation. + * + * @return the azureBastionSubnetCidrBlock value. + */ + public String azureBastionSubnetCidrBlock() { + return this.azureBastionSubnetCidrBlock; + } + + /** + * Set the azureBastionSubnetCidrBlock property: The Bastion subnet address. Specify the address using IPv4 CIDR + * notation. + * + * @param azureBastionSubnetCidrBlock the azureBastionSubnetCidrBlock value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withAzureBastionSubnetCidrBlock(String azureBastionSubnetCidrBlock) { + this.azureBastionSubnetCidrBlock = azureBastionSubnetCidrBlock; + return this; + } + + /** + * Get the landingZonesMgChildren property: The child management groups of 'Landing Zones' management group and + * their assigned policies. + * + * @return the landingZonesMgChildren value. + */ + public List landingZonesMgChildren() { + return this.landingZonesMgChildren; + } + + /** + * Set the landingZonesMgChildren property: The child management groups of 'Landing Zones' management group and + * their assigned policies. + * + * @param landingZonesMgChildren the landingZonesMgChildren value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withLandingZonesMgChildren(List landingZonesMgChildren) { + this.landingZonesMgChildren = landingZonesMgChildren; + return this; + } + + /** + * Get the topLevelMgMetadata property: The assigned policies of the parent management group. + * + * @return the topLevelMgMetadata value. + */ + public ManagementGroupPropertiesUpdate topLevelMgMetadata() { + return this.topLevelMgMetadata; + } + + /** + * Set the topLevelMgMetadata property: The assigned policies of the parent management group. + * + * @param topLevelMgMetadata the topLevelMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withTopLevelMgMetadata(ManagementGroupPropertiesUpdate topLevelMgMetadata) { + this.topLevelMgMetadata = topLevelMgMetadata; + return this; + } + + /** + * Get the landingZonesMgMetadata property: The assigned policies of the 'Landing Zones' management group. + * + * @return the landingZonesMgMetadata value. + */ + public ManagementGroupPropertiesUpdate landingZonesMgMetadata() { + return this.landingZonesMgMetadata; + } + + /** + * Set the landingZonesMgMetadata property: The assigned policies of the 'Landing Zones' management group. + * + * @param landingZonesMgMetadata the landingZonesMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withLandingZonesMgMetadata(ManagementGroupPropertiesUpdate landingZonesMgMetadata) { + this.landingZonesMgMetadata = landingZonesMgMetadata; + return this; + } + + /** + * Get the platformMgMetadata property: The assigned policies of the 'Platform' management group. + * + * @return the platformMgMetadata value. + */ + public ManagementGroupPropertiesUpdate platformMgMetadata() { + return this.platformMgMetadata; + } + + /** + * Set the platformMgMetadata property: The assigned policies of the 'Platform' management group. + * + * @param platformMgMetadata the platformMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withPlatformMgMetadata(ManagementGroupPropertiesUpdate platformMgMetadata) { + this.platformMgMetadata = platformMgMetadata; + return this; + } + + /** + * Get the platformManagementMgMetadata property: The assigned policies of the 'Management' management group under + * 'Platform' management group. + * + * @return the platformManagementMgMetadata value. + */ + public ManagementGroupPropertiesUpdate platformManagementMgMetadata() { + return this.platformManagementMgMetadata; + } + + /** + * Set the platformManagementMgMetadata property: The assigned policies of the 'Management' management group under + * 'Platform' management group. + * + * @param platformManagementMgMetadata the platformManagementMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withPlatformManagementMgMetadata(ManagementGroupPropertiesUpdate platformManagementMgMetadata) { + this.platformManagementMgMetadata = platformManagementMgMetadata; + return this; + } + + /** + * Get the platformConnectivityMgMetadata property: The assigned policies of the 'Connectivity' management group + * under 'Platform' management group. + * + * @return the platformConnectivityMgMetadata value. + */ + public ManagementGroupPropertiesUpdate platformConnectivityMgMetadata() { + return this.platformConnectivityMgMetadata; + } + + /** + * Set the platformConnectivityMgMetadata property: The assigned policies of the 'Connectivity' management group + * under 'Platform' management group. + * + * @param platformConnectivityMgMetadata the platformConnectivityMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withPlatformConnectivityMgMetadata(ManagementGroupPropertiesUpdate platformConnectivityMgMetadata) { + this.platformConnectivityMgMetadata = platformConnectivityMgMetadata; + return this; + } + + /** + * Get the platformIdentityMgMetadata property: The assigned policies of the 'Identity' management group under + * 'Platform' management group. + * + * @return the platformIdentityMgMetadata value. + */ + public ManagementGroupPropertiesUpdate platformIdentityMgMetadata() { + return this.platformIdentityMgMetadata; + } + + /** + * Set the platformIdentityMgMetadata property: The assigned policies of the 'Identity' management group under + * 'Platform' management group. + * + * @param platformIdentityMgMetadata the platformIdentityMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withPlatformIdentityMgMetadata(ManagementGroupPropertiesUpdate platformIdentityMgMetadata) { + this.platformIdentityMgMetadata = platformIdentityMgMetadata; + return this; + } + + /** + * Get the decommissionedMgMetadata property: The assigned policies of the 'Decommissioned' management group and + * indicator to create it or not. + * + * @return the decommissionedMgMetadata value. + */ + public DecommissionedManagementGroupPropertiesUpdate decommissionedMgMetadata() { + return this.decommissionedMgMetadata; + } + + /** + * Set the decommissionedMgMetadata property: The assigned policies of the 'Decommissioned' management group and + * indicator to create it or not. + * + * @param decommissionedMgMetadata the decommissionedMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withDecommissionedMgMetadata(DecommissionedManagementGroupPropertiesUpdate decommissionedMgMetadata) { + this.decommissionedMgMetadata = decommissionedMgMetadata; + return this; + } + + /** + * Get the sandboxMgMetadata property: The assigned policies of the 'Sandbox' management group and indicator to + * create it or not. + * + * @return the sandboxMgMetadata value. + */ + public SandboxManagementGroupPropertiesUpdate sandboxMgMetadata() { + return this.sandboxMgMetadata; + } + + /** + * Set the sandboxMgMetadata property: The assigned policies of the 'Sandbox' management group and indicator to + * create it or not. + * + * @param sandboxMgMetadata the sandboxMgMetadata value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withSandboxMgMetadata(SandboxManagementGroupPropertiesUpdate sandboxMgMetadata) { + this.sandboxMgMetadata = sandboxMgMetadata; + return this; + } + + /** + * Get the managedIdentity property: The managed identity to be assigned to this landing zone configuration. + * + * @return the managedIdentity value. + */ + public ManagedIdentityPropertiesUpdate managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: The managed identity to be assigned to this landing zone configuration. + * + * @param managedIdentity the managedIdentity value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withManagedIdentity(ManagedIdentityPropertiesUpdate managedIdentity) { + this.managedIdentity = managedIdentity; + return this; + } + + /** + * Get the platformMgChildren property: The names of the 'Platform' child management groups and their assigned + * policies, excluding the default ones: 'Connectivity', 'Identity', and 'Management'. + * + * @return the platformMgChildren value. + */ + public List platformMgChildren() { + return this.platformMgChildren; + } + + /** + * Set the platformMgChildren property: The names of the 'Platform' child management groups and their assigned + * policies, excluding the default ones: 'Connectivity', 'Identity', and 'Management'. + * + * @param platformMgChildren the platformMgChildren value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withPlatformMgChildren(List platformMgChildren) { + this.platformMgChildren = platformMgChildren; + return this; + } + + /** + * Get the namingConventionFormula property: The default naming convention applied to all resources for this landing + * zone configuration. Example - + * {DeploymentPrefix}-Contoso-{ResourceTypeAbbreviation}{DeploymentSuffix}-{Environment}-testing. + * + * @return the namingConventionFormula value. + */ + public String namingConventionFormula() { + return this.namingConventionFormula; + } + + /** + * Set the namingConventionFormula property: The default naming convention applied to all resources for this landing + * zone configuration. Example - + * {DeploymentPrefix}-Contoso-{ResourceTypeAbbreviation}{DeploymentSuffix}-{Environment}-testing. + * + * @param namingConventionFormula the namingConventionFormula value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withNamingConventionFormula(String namingConventionFormula) { + this.namingConventionFormula = namingConventionFormula; + return this; + } + + /** + * Get the customNamingConvention property: The custom naming convention applied to specific resource types for this + * landing zone configuration, which overrides the default naming convention for those resource types. Example - + * 'customNamingConvention': [{'resourceType': 'azureFirewalls', 'formula': + * '{DeploymentPrefix}-afwl-{DeploymentSuffix}'}]. + * + * @return the customNamingConvention value. + */ + public List customNamingConvention() { + return this.customNamingConvention; + } + + /** + * Set the customNamingConvention property: The custom naming convention applied to specific resource types for this + * landing zone configuration, which overrides the default naming convention for those resource types. Example - + * 'customNamingConvention': [{'resourceType': 'azureFirewalls', 'formula': + * '{DeploymentPrefix}-afwl-{DeploymentSuffix}'}]. + * + * @param customNamingConvention the customNamingConvention value to set. + * @return the LandingZoneConfigurationResourcePropertiesUpdate object itself. + */ + public LandingZoneConfigurationResourcePropertiesUpdate + withCustomNamingConvention(List customNamingConvention) { + this.customNamingConvention = customNamingConvention; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + if (landingZonesMgChildren() != null) { + landingZonesMgChildren().forEach(e -> e.validate()); + } + if (topLevelMgMetadata() != null) { + topLevelMgMetadata().validate(); + } + if (landingZonesMgMetadata() != null) { + landingZonesMgMetadata().validate(); + } + if (platformMgMetadata() != null) { + platformMgMetadata().validate(); + } + if (platformManagementMgMetadata() != null) { + platformManagementMgMetadata().validate(); + } + if (platformConnectivityMgMetadata() != null) { + platformConnectivityMgMetadata().validate(); + } + if (platformIdentityMgMetadata() != null) { + platformIdentityMgMetadata().validate(); + } + if (decommissionedMgMetadata() != null) { + decommissionedMgMetadata().validate(); + } + if (sandboxMgMetadata() != null) { + sandboxMgMetadata().validate(); + } + if (managedIdentity() != null) { + managedIdentity().validate(); + } + if (platformMgChildren() != null) { + platformMgChildren().forEach(e -> e.validate()); + } + if (customNamingConvention() != null) { + customNamingConvention().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ddosProtectionCreationOption", + this.ddosProtectionCreationOption == null ? null : this.ddosProtectionCreationOption.toString()); + jsonWriter.writeStringField("existingDdosProtectionId", this.existingDdosProtectionId); + jsonWriter.writeStringField("logAnalyticsWorkspaceCreationOption", + this.logAnalyticsWorkspaceCreationOption == null + ? null + : this.logAnalyticsWorkspaceCreationOption.toString()); + jsonWriter.writeStringField("existingLogAnalyticsWorkspaceId", this.existingLogAnalyticsWorkspaceId); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("firewallCreationOption", + this.firewallCreationOption == null ? null : this.firewallCreationOption.toString()); + jsonWriter.writeStringField("firewallSubnetCidrBlock", this.firewallSubnetCidrBlock); + jsonWriter.writeStringField("gatewaySubnetCidrBlock", this.gatewaySubnetCidrBlock); + jsonWriter.writeNumberField("logRetentionInDays", this.logRetentionInDays); + jsonWriter.writeStringField("hubNetworkCidrBlock", this.hubNetworkCidrBlock); + jsonWriter.writeStringField("azureBastionCreationOption", + this.azureBastionCreationOption == null ? null : this.azureBastionCreationOption.toString()); + jsonWriter.writeStringField("existingAzureBastionId", this.existingAzureBastionId); + jsonWriter.writeStringField("azureBastionSubnetCidrBlock", this.azureBastionSubnetCidrBlock); + jsonWriter.writeArrayField("landingZonesMgChildren", this.landingZonesMgChildren, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("topLevelMgMetadata", this.topLevelMgMetadata); + jsonWriter.writeJsonField("landingZonesMgMetadata", this.landingZonesMgMetadata); + jsonWriter.writeJsonField("platformMgMetadata", this.platformMgMetadata); + jsonWriter.writeJsonField("platformManagementMgMetadata", this.platformManagementMgMetadata); + jsonWriter.writeJsonField("platformConnectivityMgMetadata", this.platformConnectivityMgMetadata); + jsonWriter.writeJsonField("platformIdentityMgMetadata", this.platformIdentityMgMetadata); + jsonWriter.writeJsonField("decommissionedMgMetadata", this.decommissionedMgMetadata); + jsonWriter.writeJsonField("sandboxMgMetadata", this.sandboxMgMetadata); + jsonWriter.writeJsonField("managedIdentity", this.managedIdentity); + jsonWriter.writeArrayField("platformMgChildren", this.platformMgChildren, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("namingConventionFormula", this.namingConventionFormula); + jsonWriter.writeArrayField("customNamingConvention", this.customNamingConvention, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneConfigurationResourcePropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneConfigurationResourcePropertiesUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LandingZoneConfigurationResourcePropertiesUpdate. + */ + public static LandingZoneConfigurationResourcePropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneConfigurationResourcePropertiesUpdate deserializedLandingZoneConfigurationResourcePropertiesUpdate + = new LandingZoneConfigurationResourcePropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ddosProtectionCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.ddosProtectionCreationOption + = ResourceCreationOptions.fromString(reader.getString()); + } else if ("existingDdosProtectionId".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.existingDdosProtectionId + = reader.getString(); + } else if ("logAnalyticsWorkspaceCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.logAnalyticsWorkspaceCreationOption + = ResourceCreationOptions.fromString(reader.getString()); + } else if ("existingLogAnalyticsWorkspaceId".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.existingLogAnalyticsWorkspaceId + = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> Tags.fromJson(reader1)); + deserializedLandingZoneConfigurationResourcePropertiesUpdate.tags = tags; + } else if ("firewallCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.firewallCreationOption + = FirewallCreationOptions.fromString(reader.getString()); + } else if ("firewallSubnetCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.firewallSubnetCidrBlock + = reader.getString(); + } else if ("gatewaySubnetCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.gatewaySubnetCidrBlock + = reader.getString(); + } else if ("logRetentionInDays".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.logRetentionInDays + = reader.getNullable(JsonReader::getLong); + } else if ("hubNetworkCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.hubNetworkCidrBlock + = reader.getString(); + } else if ("azureBastionCreationOption".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.azureBastionCreationOption + = ResourceCreationOptions.fromString(reader.getString()); + } else if ("existingAzureBastionId".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.existingAzureBastionId + = reader.getString(); + } else if ("azureBastionSubnetCidrBlock".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.azureBastionSubnetCidrBlock + = reader.getString(); + } else if ("landingZonesMgChildren".equals(fieldName)) { + List landingZonesMgChildren + = reader.readArray(reader1 -> LandingZoneManagementGroupProperties.fromJson(reader1)); + deserializedLandingZoneConfigurationResourcePropertiesUpdate.landingZonesMgChildren + = landingZonesMgChildren; + } else if ("topLevelMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.topLevelMgMetadata + = ManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("landingZonesMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.landingZonesMgMetadata + = ManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("platformMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.platformMgMetadata + = ManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("platformManagementMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.platformManagementMgMetadata + = ManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("platformConnectivityMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.platformConnectivityMgMetadata + = ManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("platformIdentityMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.platformIdentityMgMetadata + = ManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("decommissionedMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.decommissionedMgMetadata + = DecommissionedManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("sandboxMgMetadata".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.sandboxMgMetadata + = SandboxManagementGroupPropertiesUpdate.fromJson(reader); + } else if ("managedIdentity".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.managedIdentity + = ManagedIdentityPropertiesUpdate.fromJson(reader); + } else if ("platformMgChildren".equals(fieldName)) { + List platformMgChildren + = reader.readArray(reader1 -> PlatformManagementGroupProperties.fromJson(reader1)); + deserializedLandingZoneConfigurationResourcePropertiesUpdate.platformMgChildren + = platformMgChildren; + } else if ("namingConventionFormula".equals(fieldName)) { + deserializedLandingZoneConfigurationResourcePropertiesUpdate.namingConventionFormula + = reader.getString(); + } else if ("customNamingConvention".equals(fieldName)) { + List customNamingConvention + = reader.readArray(reader1 -> CustomNamingConvention.fromJson(reader1)); + deserializedLandingZoneConfigurationResourcePropertiesUpdate.customNamingConvention + = customNamingConvention; + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneConfigurationResourcePropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceUpdate.java new file mode 100644 index 000000000000..4b141128187d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneConfigurationResourceUpdate.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Concrete proxy resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class LandingZoneConfigurationResourceUpdate extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private LandingZoneConfigurationResourcePropertiesUpdate properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LandingZoneConfigurationResourceUpdate class. + */ + public LandingZoneConfigurationResourceUpdate() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LandingZoneConfigurationResourcePropertiesUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LandingZoneConfigurationResourceUpdate object itself. + */ + public LandingZoneConfigurationResourceUpdate + withProperties(LandingZoneConfigurationResourcePropertiesUpdate properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneConfigurationResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneConfigurationResourceUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneConfigurationResourceUpdate. + */ + public static LandingZoneConfigurationResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneConfigurationResourceUpdate deserializedLandingZoneConfigurationResourceUpdate + = new LandingZoneConfigurationResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceUpdate.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceUpdate.properties + = LandingZoneConfigurationResourcePropertiesUpdate.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLandingZoneConfigurationResourceUpdate.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneConfigurationResourceUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneManagementGroupProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneManagementGroupProperties.java new file mode 100644 index 000000000000..c9e1caad33fe --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneManagementGroupProperties.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The 'Landing Zones' management group properties.. + */ +@Fluent +public final class LandingZoneManagementGroupProperties + implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /* + * Management group name. + */ + private String name; + + /** + * Creates an instance of LandingZoneManagementGroupProperties class. + */ + public LandingZoneManagementGroupProperties() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the LandingZoneManagementGroupProperties object itself. + */ + public LandingZoneManagementGroupProperties withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Get the name property: Management group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Management group name. + * + * @param name the name value to set. + * @return the LandingZoneManagementGroupProperties object itself. + */ + public LandingZoneManagementGroupProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyInitiativesAssignmentProperties in model LandingZoneManagementGroupProperties")); + } else { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model LandingZoneManagementGroupProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneManagementGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneManagementGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneManagementGroupProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneManagementGroupProperties. + */ + public static LandingZoneManagementGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneManagementGroupProperties deserializedLandingZoneManagementGroupProperties + = new LandingZoneManagementGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedLandingZoneManagementGroupProperties.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else if ("name".equals(fieldName)) { + deserializedLandingZoneManagementGroupProperties.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneManagementGroupProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationOperations.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationOperations.java new file mode 100644 index 000000000000..455963844ebe --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationOperations.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.sovereign.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 LandingZoneRegistrationOperations. + */ +public interface LandingZoneRegistrationOperations { + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listBySubscription(String landingZoneAccountName); + + /** + * List the landing zone registrations within a subscription. + * + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listBySubscription(String landingZoneAccountName, Context context); + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName); + + /** + * List the landing zone registrations within a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a LandingZoneRegistrationResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, + String landingZoneAccountName, Context context); + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, Context context); + + /** + * Get a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration. + */ + LandingZoneRegistrationResource get(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName); + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String resourceGroupName, String landingZoneAccountName, + String landingZoneRegistrationName, Context context); + + /** + * Delete a landing zone registration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @param landingZoneRegistrationName The name of the landing zone registration resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String landingZoneAccountName, String landingZoneRegistrationName); + + /** + * Get a landing zone registration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response}. + */ + LandingZoneRegistrationResource getById(String id); + + /** + * Get a landing zone registration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a landing zone registration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a landing zone registration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a landing zone registration. + * + * @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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new LandingZoneRegistrationResource resource. + * + * @param name resource name. + * @return the first stage of the new LandingZoneRegistrationResource definition. + */ + LandingZoneRegistrationResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResource.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResource.java new file mode 100644 index 000000000000..2ffe1f22d965 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResource.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneRegistrationResourceInner; + +/** + * An immutable client-side representation of LandingZoneRegistrationResource. + */ +public interface LandingZoneRegistrationResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + LandingZoneRegistrationResourceProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.LandingZoneRegistrationResourceInner object. + * + * @return the inner object. + */ + LandingZoneRegistrationResourceInner innerModel(); + + /** + * The entirety of the LandingZoneRegistrationResource definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The LandingZoneRegistrationResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the LandingZoneRegistrationResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the LandingZoneRegistrationResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, landingZoneAccountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param landingZoneAccountName The landing zone account. + * @return the next definition stage. + */ + WithCreate withExistingLandingZoneAccount(String resourceGroupName, String landingZoneAccountName); + } + + /** + * The stage of the LandingZoneRegistrationResource 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. + */ + LandingZoneRegistrationResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + LandingZoneRegistrationResource create(Context context); + } + + /** + * The stage of the LandingZoneRegistrationResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(LandingZoneRegistrationResourceProperties properties); + } + } + + /** + * Begins update for the LandingZoneRegistrationResource resource. + * + * @return the stage of resource update. + */ + LandingZoneRegistrationResource.Update update(); + + /** + * The template for LandingZoneRegistrationResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + LandingZoneRegistrationResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + LandingZoneRegistrationResource apply(Context context); + } + + /** + * The LandingZoneRegistrationResource update stages. + */ + interface UpdateStages { + /** + * The stage of the LandingZoneRegistrationResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(LandingZoneRegistrationResourcePropertiesUpdate properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + LandingZoneRegistrationResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + LandingZoneRegistrationResource refresh(Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceListResult.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceListResult.java new file mode 100644 index 000000000000..620f2274f68e --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceListResult.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.fluent.models.LandingZoneRegistrationResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a LandingZoneRegistrationResource list operation. + */ +@Fluent +public final class LandingZoneRegistrationResourceListResult + implements JsonSerializable { + /* + * The LandingZoneRegistrationResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of LandingZoneRegistrationResourceListResult class. + */ + public LandingZoneRegistrationResourceListResult() { + } + + /** + * Get the value property: The LandingZoneRegistrationResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The LandingZoneRegistrationResource items on this page. + * + * @param value the value value to set. + * @return the LandingZoneRegistrationResourceListResult object itself. + */ + public LandingZoneRegistrationResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the LandingZoneRegistrationResourceListResult object itself. + */ + public LandingZoneRegistrationResourceListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model LandingZoneRegistrationResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneRegistrationResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneRegistrationResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneRegistrationResourceListResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneRegistrationResourceListResult. + */ + public static LandingZoneRegistrationResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneRegistrationResourceListResult deserializedLandingZoneRegistrationResourceListResult + = new LandingZoneRegistrationResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> LandingZoneRegistrationResourceInner.fromJson(reader1)); + deserializedLandingZoneRegistrationResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneRegistrationResourceListResult; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceProperties.java new file mode 100644 index 000000000000..5c7353096fae --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceProperties.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of landing zone registration resource type. + */ +@Fluent +public final class LandingZoneRegistrationResourceProperties + implements JsonSerializable { + /* + * The state that reflects the current stage in the creation, updating, or deletion process of the landing zone + * registration resource type. + */ + private ProvisioningState provisioningState; + + /* + * The resource id of the top level management group + */ + private String existingTopLevelMgId; + + /* + * The resource id of the associated landing zone configuration. + */ + private String existingLandingZoneConfigurationId; + + /* + * The managed identity to be assigned to this landing zone registration. + */ + private ManagedIdentityProperties managedIdentity; + + /** + * Creates an instance of LandingZoneRegistrationResourceProperties class. + */ + public LandingZoneRegistrationResourceProperties() { + } + + /** + * Get the provisioningState property: The state that reflects the current stage in the creation, updating, or + * deletion process of the landing zone registration resource type. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the existingTopLevelMgId property: The resource id of the top level management group. + * + * @return the existingTopLevelMgId value. + */ + public String existingTopLevelMgId() { + return this.existingTopLevelMgId; + } + + /** + * Set the existingTopLevelMgId property: The resource id of the top level management group. + * + * @param existingTopLevelMgId the existingTopLevelMgId value to set. + * @return the LandingZoneRegistrationResourceProperties object itself. + */ + public LandingZoneRegistrationResourceProperties withExistingTopLevelMgId(String existingTopLevelMgId) { + this.existingTopLevelMgId = existingTopLevelMgId; + return this; + } + + /** + * Get the existingLandingZoneConfigurationId property: The resource id of the associated landing zone + * configuration. + * + * @return the existingLandingZoneConfigurationId value. + */ + public String existingLandingZoneConfigurationId() { + return this.existingLandingZoneConfigurationId; + } + + /** + * Set the existingLandingZoneConfigurationId property: The resource id of the associated landing zone + * configuration. + * + * @param existingLandingZoneConfigurationId the existingLandingZoneConfigurationId value to set. + * @return the LandingZoneRegistrationResourceProperties object itself. + */ + public LandingZoneRegistrationResourceProperties + withExistingLandingZoneConfigurationId(String existingLandingZoneConfigurationId) { + this.existingLandingZoneConfigurationId = existingLandingZoneConfigurationId; + return this; + } + + /** + * Get the managedIdentity property: The managed identity to be assigned to this landing zone registration. + * + * @return the managedIdentity value. + */ + public ManagedIdentityProperties managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: The managed identity to be assigned to this landing zone registration. + * + * @param managedIdentity the managedIdentity value to set. + * @return the LandingZoneRegistrationResourceProperties object itself. + */ + public LandingZoneRegistrationResourceProperties withManagedIdentity(ManagedIdentityProperties managedIdentity) { + this.managedIdentity = managedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (existingTopLevelMgId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property existingTopLevelMgId in model LandingZoneRegistrationResourceProperties")); + } + if (existingLandingZoneConfigurationId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property existingLandingZoneConfigurationId in model LandingZoneRegistrationResourceProperties")); + } + if (managedIdentity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property managedIdentity in model LandingZoneRegistrationResourceProperties")); + } else { + managedIdentity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LandingZoneRegistrationResourceProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("existingTopLevelMgId", this.existingTopLevelMgId); + jsonWriter.writeStringField("existingLandingZoneConfigurationId", this.existingLandingZoneConfigurationId); + jsonWriter.writeJsonField("managedIdentity", this.managedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneRegistrationResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneRegistrationResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneRegistrationResourceProperties. + */ + public static LandingZoneRegistrationResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneRegistrationResourceProperties deserializedLandingZoneRegistrationResourceProperties + = new LandingZoneRegistrationResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("existingTopLevelMgId".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceProperties.existingTopLevelMgId = reader.getString(); + } else if ("existingLandingZoneConfigurationId".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceProperties.existingLandingZoneConfigurationId + = reader.getString(); + } else if ("managedIdentity".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceProperties.managedIdentity + = ManagedIdentityProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneRegistrationResourceProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourcePropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourcePropertiesUpdate.java new file mode 100644 index 000000000000..4ee8dcef9da9 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourcePropertiesUpdate.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of landing zone registration resource type. + */ +@Fluent +public final class LandingZoneRegistrationResourcePropertiesUpdate + implements JsonSerializable { + /* + * The resource id of the top level management group + */ + private String existingTopLevelMgId; + + /* + * The resource id of the associated landing zone configuration. + */ + private String existingLandingZoneConfigurationId; + + /* + * The managed identity to be assigned to this landing zone registration. + */ + private ManagedIdentityPropertiesUpdate managedIdentity; + + /** + * Creates an instance of LandingZoneRegistrationResourcePropertiesUpdate class. + */ + public LandingZoneRegistrationResourcePropertiesUpdate() { + } + + /** + * Get the existingTopLevelMgId property: The resource id of the top level management group. + * + * @return the existingTopLevelMgId value. + */ + public String existingTopLevelMgId() { + return this.existingTopLevelMgId; + } + + /** + * Set the existingTopLevelMgId property: The resource id of the top level management group. + * + * @param existingTopLevelMgId the existingTopLevelMgId value to set. + * @return the LandingZoneRegistrationResourcePropertiesUpdate object itself. + */ + public LandingZoneRegistrationResourcePropertiesUpdate withExistingTopLevelMgId(String existingTopLevelMgId) { + this.existingTopLevelMgId = existingTopLevelMgId; + return this; + } + + /** + * Get the existingLandingZoneConfigurationId property: The resource id of the associated landing zone + * configuration. + * + * @return the existingLandingZoneConfigurationId value. + */ + public String existingLandingZoneConfigurationId() { + return this.existingLandingZoneConfigurationId; + } + + /** + * Set the existingLandingZoneConfigurationId property: The resource id of the associated landing zone + * configuration. + * + * @param existingLandingZoneConfigurationId the existingLandingZoneConfigurationId value to set. + * @return the LandingZoneRegistrationResourcePropertiesUpdate object itself. + */ + public LandingZoneRegistrationResourcePropertiesUpdate + withExistingLandingZoneConfigurationId(String existingLandingZoneConfigurationId) { + this.existingLandingZoneConfigurationId = existingLandingZoneConfigurationId; + return this; + } + + /** + * Get the managedIdentity property: The managed identity to be assigned to this landing zone registration. + * + * @return the managedIdentity value. + */ + public ManagedIdentityPropertiesUpdate managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: The managed identity to be assigned to this landing zone registration. + * + * @param managedIdentity the managedIdentity value to set. + * @return the LandingZoneRegistrationResourcePropertiesUpdate object itself. + */ + public LandingZoneRegistrationResourcePropertiesUpdate + withManagedIdentity(ManagedIdentityPropertiesUpdate managedIdentity) { + this.managedIdentity = managedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedIdentity() != null) { + managedIdentity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("existingTopLevelMgId", this.existingTopLevelMgId); + jsonWriter.writeStringField("existingLandingZoneConfigurationId", this.existingLandingZoneConfigurationId); + jsonWriter.writeJsonField("managedIdentity", this.managedIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneRegistrationResourcePropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneRegistrationResourcePropertiesUpdate if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LandingZoneRegistrationResourcePropertiesUpdate. + */ + public static LandingZoneRegistrationResourcePropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneRegistrationResourcePropertiesUpdate deserializedLandingZoneRegistrationResourcePropertiesUpdate + = new LandingZoneRegistrationResourcePropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("existingTopLevelMgId".equals(fieldName)) { + deserializedLandingZoneRegistrationResourcePropertiesUpdate.existingTopLevelMgId + = reader.getString(); + } else if ("existingLandingZoneConfigurationId".equals(fieldName)) { + deserializedLandingZoneRegistrationResourcePropertiesUpdate.existingLandingZoneConfigurationId + = reader.getString(); + } else if ("managedIdentity".equals(fieldName)) { + deserializedLandingZoneRegistrationResourcePropertiesUpdate.managedIdentity + = ManagedIdentityPropertiesUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneRegistrationResourcePropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceUpdate.java new file mode 100644 index 000000000000..db3fd39eecd8 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/LandingZoneRegistrationResourceUpdate.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Landing zone registration resource type. + */ +@Fluent +public final class LandingZoneRegistrationResourceUpdate extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private LandingZoneRegistrationResourcePropertiesUpdate properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of LandingZoneRegistrationResourceUpdate class. + */ + public LandingZoneRegistrationResourceUpdate() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public LandingZoneRegistrationResourcePropertiesUpdate properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the LandingZoneRegistrationResourceUpdate object itself. + */ + public LandingZoneRegistrationResourceUpdate + withProperties(LandingZoneRegistrationResourcePropertiesUpdate properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LandingZoneRegistrationResourceUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LandingZoneRegistrationResourceUpdate if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LandingZoneRegistrationResourceUpdate. + */ + public static LandingZoneRegistrationResourceUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LandingZoneRegistrationResourceUpdate deserializedLandingZoneRegistrationResourceUpdate + = new LandingZoneRegistrationResourceUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceUpdate.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceUpdate.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceUpdate.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceUpdate.properties + = LandingZoneRegistrationResourcePropertiesUpdate.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLandingZoneRegistrationResourceUpdate.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLandingZoneRegistrationResourceUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityProperties.java new file mode 100644 index 000000000000..c200f2402149 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of managed identity, specifically including type and resource ID. + */ +@Fluent +public final class ManagedIdentityProperties implements JsonSerializable { + /* + * The type of managed identity. + */ + private ManagedIdentityResourceType type; + + /* + * The resource id of the managed identity. + */ + private String userAssignedIdentityResourceId; + + /** + * Creates an instance of ManagedIdentityProperties class. + */ + public ManagedIdentityProperties() { + } + + /** + * Get the type property: The type of managed identity. + * + * @return the type value. + */ + public ManagedIdentityResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity. + * + * @param type the type value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withType(ManagedIdentityResourceType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentityResourceId property: The resource id of the managed identity. + * + * @return the userAssignedIdentityResourceId value. + */ + public String userAssignedIdentityResourceId() { + return this.userAssignedIdentityResourceId; + } + + /** + * Set the userAssignedIdentityResourceId property: The resource id of the managed identity. + * + * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withUserAssignedIdentityResourceId(String userAssignedIdentityResourceId) { + this.userAssignedIdentityResourceId = userAssignedIdentityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property type in model ManagedIdentityProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedIdentityProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("userAssignedIdentityResourceId", this.userAssignedIdentityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedIdentityProperties. + */ + public static ManagedIdentityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityProperties deserializedManagedIdentityProperties = new ManagedIdentityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedIdentityProperties.type + = ManagedIdentityResourceType.fromString(reader.getString()); + } else if ("userAssignedIdentityResourceId".equals(fieldName)) { + deserializedManagedIdentityProperties.userAssignedIdentityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityPropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityPropertiesUpdate.java new file mode 100644 index 000000000000..a4e872334577 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityPropertiesUpdate.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of managed identity, specifically including type and resource ID. + */ +@Fluent +public final class ManagedIdentityPropertiesUpdate implements JsonSerializable { + /* + * The type of managed identity. + */ + private ManagedIdentityResourceType type; + + /* + * The resource id of the managed identity. + */ + private String userAssignedIdentityResourceId; + + /** + * Creates an instance of ManagedIdentityPropertiesUpdate class. + */ + public ManagedIdentityPropertiesUpdate() { + } + + /** + * Get the type property: The type of managed identity. + * + * @return the type value. + */ + public ManagedIdentityResourceType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity. + * + * @param type the type value to set. + * @return the ManagedIdentityPropertiesUpdate object itself. + */ + public ManagedIdentityPropertiesUpdate withType(ManagedIdentityResourceType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentityResourceId property: The resource id of the managed identity. + * + * @return the userAssignedIdentityResourceId value. + */ + public String userAssignedIdentityResourceId() { + return this.userAssignedIdentityResourceId; + } + + /** + * Set the userAssignedIdentityResourceId property: The resource id of the managed identity. + * + * @param userAssignedIdentityResourceId the userAssignedIdentityResourceId value to set. + * @return the ManagedIdentityPropertiesUpdate object itself. + */ + public ManagedIdentityPropertiesUpdate withUserAssignedIdentityResourceId(String userAssignedIdentityResourceId) { + this.userAssignedIdentityResourceId = userAssignedIdentityResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("userAssignedIdentityResourceId", this.userAssignedIdentityResourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedIdentityPropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedIdentityPropertiesUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedIdentityPropertiesUpdate. + */ + public static ManagedIdentityPropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedIdentityPropertiesUpdate deserializedManagedIdentityPropertiesUpdate + = new ManagedIdentityPropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedIdentityPropertiesUpdate.type + = ManagedIdentityResourceType.fromString(reader.getString()); + } else if ("userAssignedIdentityResourceId".equals(fieldName)) { + deserializedManagedIdentityPropertiesUpdate.userAssignedIdentityResourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedIdentityPropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityResourceType.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityResourceType.java new file mode 100644 index 000000000000..3035ac140298 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedIdentityResourceType.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.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The managed identity resource. + */ +public final class ManagedIdentityResourceType extends ExpandableStringEnum { + /** + * Static value SystemAssigned for ManagedIdentityResourceType. + */ + public static final ManagedIdentityResourceType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedIdentityResourceType. + */ + public static final ManagedIdentityResourceType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates a new instance of ManagedIdentityResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedIdentityResourceType() { + } + + /** + * Creates or finds a ManagedIdentityResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityResourceType. + */ + public static ManagedIdentityResourceType fromString(String name) { + return fromString(name, ManagedIdentityResourceType.class); + } + + /** + * Gets known ManagedIdentityResourceType values. + * + * @return known ManagedIdentityResourceType values. + */ + public static Collection values() { + return values(ManagedIdentityResourceType.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentity.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..0c0c1a90289a --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentity.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; +import java.util.UUID; + +/** + * Managed service identity (system assigned and/or user assigned identities). + */ +@Fluent +public final class ManagedServiceIdentity implements JsonSerializable { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + 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. + */ + private Map userAssignedIdentities; + + /** + * Creates an instance of ManagedServiceIdentity class. + */ + public ManagedServiceIdentity() { + } + + /** + * 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.atError() + .log(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); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentityType.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..5e87e38f3061 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagedServiceIdentityType.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.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +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 a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupProperties.java new file mode 100644 index 000000000000..95d8c780bae5 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupProperties.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties of policy initiatives applied to the management group. + */ +@Fluent +public final class ManagementGroupProperties implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /** + * Creates an instance of ManagementGroupProperties class. + */ + public ManagementGroupProperties() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the ManagementGroupProperties object itself. + */ + public ManagementGroupProperties withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyInitiativesAssignmentProperties in model ManagementGroupProperties")); + } else { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementGroupProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagementGroupProperties. + */ + public static ManagementGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementGroupProperties deserializedManagementGroupProperties = new ManagementGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedManagementGroupProperties.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementGroupProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupPropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupPropertiesUpdate.java new file mode 100644 index 000000000000..ea1de66c27c3 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ManagementGroupPropertiesUpdate.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties of policy initiatives applied to the management group. + */ +@Fluent +public final class ManagementGroupPropertiesUpdate implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /** + * Creates an instance of ManagementGroupPropertiesUpdate class. + */ + public ManagementGroupPropertiesUpdate() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the ManagementGroupPropertiesUpdate object itself. + */ + public ManagementGroupPropertiesUpdate withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() != null) { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementGroupPropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementGroupPropertiesUpdate if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagementGroupPropertiesUpdate. + */ + public static ManagementGroupPropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementGroupPropertiesUpdate deserializedManagementGroupPropertiesUpdate + = new ManagementGroupPropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedManagementGroupPropertiesUpdate.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementGroupPropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operation.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operation.java new file mode 100644 index 000000000000..3e1fd7913cb9 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operation.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.sovereign.models; + +import com.azure.resourcemanager.sovereign.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationDisplay.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationDisplay.java new file mode 100644 index 000000000000..0a263e2555d1 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationDisplay.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for this particular operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationListResult.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationListResult.java new file mode 100644 index 000000000000..e4f06a94a7a9 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/OperationListResult.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.sovereign.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * List of operations supported by the resource provider + */ + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operations.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operations.java new file mode 100644 index 000000000000..f7be367cf770 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Origin.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Origin.java new file mode 100644 index 000000000000..f6e9acd92409 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Origin.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.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PlatformManagementGroupProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PlatformManagementGroupProperties.java new file mode 100644 index 000000000000..24ff42264a57 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PlatformManagementGroupProperties.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The 'Platform' management group properties. + */ +@Fluent +public final class PlatformManagementGroupProperties implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /* + * Management group name. + */ + private String name; + + /** + * Creates an instance of PlatformManagementGroupProperties class. + */ + public PlatformManagementGroupProperties() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the PlatformManagementGroupProperties object itself. + */ + public PlatformManagementGroupProperties withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Get the name property: Management group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Management group name. + * + * @param name the name value to set. + * @return the PlatformManagementGroupProperties object itself. + */ + public PlatformManagementGroupProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyInitiativesAssignmentProperties in model PlatformManagementGroupProperties")); + } else { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model PlatformManagementGroupProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PlatformManagementGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PlatformManagementGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PlatformManagementGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PlatformManagementGroupProperties. + */ + public static PlatformManagementGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PlatformManagementGroupProperties deserializedPlatformManagementGroupProperties + = new PlatformManagementGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedPlatformManagementGroupProperties.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else if ("name".equals(fieldName)) { + deserializedPlatformManagementGroupProperties.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPlatformManagementGroupProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PolicyInitiativeAssignmentProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PolicyInitiativeAssignmentProperties.java new file mode 100644 index 000000000000..caed98352c90 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/PolicyInitiativeAssignmentProperties.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The properties of assigned policy initiatives. + */ +@Fluent +public final class PolicyInitiativeAssignmentProperties + implements JsonSerializable { + /* + * The fully qualified id of the policy initiative. + */ + private String policyInitiativeId; + + /* + * The parameters of the assigned policy initiative. + */ + private Map assignmentParameters; + + /** + * Creates an instance of PolicyInitiativeAssignmentProperties class. + */ + public PolicyInitiativeAssignmentProperties() { + } + + /** + * Get the policyInitiativeId property: The fully qualified id of the policy initiative. + * + * @return the policyInitiativeId value. + */ + public String policyInitiativeId() { + return this.policyInitiativeId; + } + + /** + * Set the policyInitiativeId property: The fully qualified id of the policy initiative. + * + * @param policyInitiativeId the policyInitiativeId value to set. + * @return the PolicyInitiativeAssignmentProperties object itself. + */ + public PolicyInitiativeAssignmentProperties withPolicyInitiativeId(String policyInitiativeId) { + this.policyInitiativeId = policyInitiativeId; + return this; + } + + /** + * Get the assignmentParameters property: The parameters of the assigned policy initiative. + * + * @return the assignmentParameters value. + */ + public Map assignmentParameters() { + return this.assignmentParameters; + } + + /** + * Set the assignmentParameters property: The parameters of the assigned policy initiative. + * + * @param assignmentParameters the assignmentParameters value to set. + * @return the PolicyInitiativeAssignmentProperties object itself. + */ + public PolicyInitiativeAssignmentProperties withAssignmentParameters(Map assignmentParameters) { + this.assignmentParameters = assignmentParameters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativeId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyInitiativeId in model PolicyInitiativeAssignmentProperties")); + } + if (assignmentParameters() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property assignmentParameters in model PolicyInitiativeAssignmentProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PolicyInitiativeAssignmentProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policyInitiativeId", this.policyInitiativeId); + jsonWriter.writeMapField("assignmentParameters", this.assignmentParameters, + (writer, element) -> writer.writeUntyped(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicyInitiativeAssignmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicyInitiativeAssignmentProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PolicyInitiativeAssignmentProperties. + */ + public static PolicyInitiativeAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicyInitiativeAssignmentProperties deserializedPolicyInitiativeAssignmentProperties + = new PolicyInitiativeAssignmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativeId".equals(fieldName)) { + deserializedPolicyInitiativeAssignmentProperties.policyInitiativeId = reader.getString(); + } else if ("assignmentParameters".equals(fieldName)) { + Map assignmentParameters = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedPolicyInitiativeAssignmentProperties.assignmentParameters = assignmentParameters; + } else { + reader.skipChildren(); + } + } + + return deserializedPolicyInitiativeAssignmentProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ProvisioningState.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ProvisioningState.java new file mode 100644 index 000000000000..6ee337614c91 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The custom provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Static value Succeeded for ProvisioningState. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ProvisioningState. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ProvisioningState. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for ProvisioningState. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for ProvisioningState. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceCreationOptions.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceCreationOptions.java new file mode 100644 index 000000000000..fd95d998157b --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceCreationOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Options for resource creation. + */ +public final class ResourceCreationOptions extends ExpandableStringEnum { + /** + * Static value Yes for ResourceCreationOptions. + */ + public static final ResourceCreationOptions YES = fromString("Yes"); + + /** + * Static value No for ResourceCreationOptions. + */ + public static final ResourceCreationOptions NO = fromString("No"); + + /** + * Static value UseExisting for ResourceCreationOptions. + */ + public static final ResourceCreationOptions USE_EXISTING = fromString("UseExisting"); + + /** + * Creates a new instance of ResourceCreationOptions value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceCreationOptions() { + } + + /** + * Creates or finds a ResourceCreationOptions from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceCreationOptions. + */ + public static ResourceCreationOptions fromString(String name) { + return fromString(name, ResourceCreationOptions.class); + } + + /** + * Gets known ResourceCreationOptions values. + * + * @return known ResourceCreationOptions values. + */ + public static Collection values() { + return values(ResourceCreationOptions.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceType.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceType.java new file mode 100644 index 000000000000..afb404228071 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/ResourceType.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.sovereign.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The input values for resource types for custom naming conventions. + */ +public final class ResourceType extends ExpandableStringEnum { + /** + * Static value azureFirewalls for ResourceType. + */ + public static final ResourceType AZURE_FIREWALLS = fromString("azureFirewalls"); + + /** + * Static value workspaces for ResourceType. + */ + public static final ResourceType WORKSPACES = fromString("workspaces"); + + /** + * Static value automationAccounts for ResourceType. + */ + public static final ResourceType AUTOMATION_ACCOUNTS = fromString("automationAccounts"); + + /** + * Static value dashboards for ResourceType. + */ + public static final ResourceType DASHBOARDS = fromString("dashboards"); + + /** + * Static value userAssignedIdentities for ResourceType. + */ + public static final ResourceType USER_ASSIGNED_IDENTITIES = fromString("userAssignedIdentities"); + + /** + * Static value bastionHosts for ResourceType. + */ + public static final ResourceType BASTION_HOSTS = fromString("bastionHosts"); + + /** + * Static value ddosProtectionPlans for ResourceType. + */ + public static final ResourceType DDOS_PROTECTION_PLANS = fromString("ddosProtectionPlans"); + + /** + * Static value networkSecurityGroups for ResourceType. + */ + public static final ResourceType NETWORK_SECURITY_GROUPS = fromString("networkSecurityGroups"); + + /** + * Static value virtualNetworks for ResourceType. + */ + public static final ResourceType VIRTUAL_NETWORKS = fromString("virtualNetworks"); + + /** + * Static value routeTables for ResourceType. + */ + public static final ResourceType ROUTE_TABLES = fromString("routeTables"); + + /** + * Creates a new instance of ResourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceType() { + } + + /** + * Creates or finds a ResourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceType. + */ + public static ResourceType fromString(String name) { + return fromString(name, ResourceType.class); + } + + /** + * Gets known ResourceType values. + * + * @return known ResourceType values. + */ + public static Collection values() { + return values(ResourceType.class); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupProperties.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupProperties.java new file mode 100644 index 000000000000..a2cf0a925ca8 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The 'Sandbox' management group properties. + */ +@Fluent +public final class SandboxManagementGroupProperties implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /* + * This parameter determines whether the 'Sandbox' management group will be created. If set to true, the group will + * be created; if set to false, it will not be created. The default value is false. + */ + private boolean create; + + /** + * Creates an instance of SandboxManagementGroupProperties class. + */ + public SandboxManagementGroupProperties() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the SandboxManagementGroupProperties object itself. + */ + public SandboxManagementGroupProperties withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Get the create property: This parameter determines whether the 'Sandbox' management group will be created. If set + * to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @return the create value. + */ + public boolean create() { + return this.create; + } + + /** + * Set the create property: This parameter determines whether the 'Sandbox' management group will be created. If set + * to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @param create the create value to set. + * @return the SandboxManagementGroupProperties object itself. + */ + public SandboxManagementGroupProperties withCreate(boolean create) { + this.create = create; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property policyInitiativesAssignmentProperties in model SandboxManagementGroupProperties")); + } else { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SandboxManagementGroupProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("create", this.create); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SandboxManagementGroupProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxManagementGroupProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SandboxManagementGroupProperties. + */ + public static SandboxManagementGroupProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxManagementGroupProperties deserializedSandboxManagementGroupProperties + = new SandboxManagementGroupProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedSandboxManagementGroupProperties.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else if ("create".equals(fieldName)) { + deserializedSandboxManagementGroupProperties.create = reader.getBoolean(); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxManagementGroupProperties; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupPropertiesUpdate.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupPropertiesUpdate.java new file mode 100644 index 000000000000..ef2ac50cfc28 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/SandboxManagementGroupPropertiesUpdate.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The 'Sandbox' management group properties. + */ +@Fluent +public final class SandboxManagementGroupPropertiesUpdate + implements JsonSerializable { + /* + * Array of policy initiatives applied to the management group. + */ + private List policyInitiativesAssignmentProperties; + + /* + * This parameter determines whether the 'Sandbox' management group will be created. If set to true, the group will + * be created; if set to false, it will not be created. The default value is false. + */ + private Boolean create; + + /** + * Creates an instance of SandboxManagementGroupPropertiesUpdate class. + */ + public SandboxManagementGroupPropertiesUpdate() { + } + + /** + * Get the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @return the policyInitiativesAssignmentProperties value. + */ + public List policyInitiativesAssignmentProperties() { + return this.policyInitiativesAssignmentProperties; + } + + /** + * Set the policyInitiativesAssignmentProperties property: Array of policy initiatives applied to the management + * group. + * + * @param policyInitiativesAssignmentProperties the policyInitiativesAssignmentProperties value to set. + * @return the SandboxManagementGroupPropertiesUpdate object itself. + */ + public SandboxManagementGroupPropertiesUpdate withPolicyInitiativesAssignmentProperties( + List policyInitiativesAssignmentProperties) { + this.policyInitiativesAssignmentProperties = policyInitiativesAssignmentProperties; + return this; + } + + /** + * Get the create property: This parameter determines whether the 'Sandbox' management group will be created. If set + * to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @return the create value. + */ + public Boolean create() { + return this.create; + } + + /** + * Set the create property: This parameter determines whether the 'Sandbox' management group will be created. If set + * to true, the group will be created; if set to false, it will not be created. The default value is false. + * + * @param create the create value to set. + * @return the SandboxManagementGroupPropertiesUpdate object itself. + */ + public SandboxManagementGroupPropertiesUpdate withCreate(Boolean create) { + this.create = create; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (policyInitiativesAssignmentProperties() != null) { + policyInitiativesAssignmentProperties().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("policyInitiativesAssignmentProperties", this.policyInitiativesAssignmentProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("create", this.create); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SandboxManagementGroupPropertiesUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SandboxManagementGroupPropertiesUpdate if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the SandboxManagementGroupPropertiesUpdate. + */ + public static SandboxManagementGroupPropertiesUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SandboxManagementGroupPropertiesUpdate deserializedSandboxManagementGroupPropertiesUpdate + = new SandboxManagementGroupPropertiesUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyInitiativesAssignmentProperties".equals(fieldName)) { + List policyInitiativesAssignmentProperties + = reader.readArray(reader1 -> PolicyInitiativeAssignmentProperties.fromJson(reader1)); + deserializedSandboxManagementGroupPropertiesUpdate.policyInitiativesAssignmentProperties + = policyInitiativesAssignmentProperties; + } else if ("create".equals(fieldName)) { + deserializedSandboxManagementGroupPropertiesUpdate.create + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedSandboxManagementGroupPropertiesUpdate; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Tags.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Tags.java new file mode 100644 index 000000000000..732d54f35d68 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/Tags.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Key-value pairs that can be assigned to this resource. + */ +@Fluent +public final class Tags implements JsonSerializable { + /* + * A tag name. + */ + private String name; + + /* + * A tag value. + */ + private String value; + + /** + * Creates an instance of Tags class. + */ + public Tags() { + } + + /** + * Get the name property: A tag name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: A tag name. + * + * @param name the name value to set. + * @return the Tags object itself. + */ + public Tags withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: A tag value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: A tag value. + * + * @param value the value value to set. + * @return the Tags object itself. + */ + public Tags withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Tags")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Tags.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Tags from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Tags if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Tags. + */ + public static Tags fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Tags deserializedTags = new Tags(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTags.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTags.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTags; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusRequest.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusRequest.java new file mode 100644 index 000000000000..e9959f1c166b --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusRequest.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.sovereign.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The request to update the authoring status of a configuration. + */ +@Fluent +public final class UpdateAuthoringStatusRequest implements JsonSerializable { + /* + * The authoring status value to be updated. Possible values include: 'Authoring', 'ReadyForUse' and 'Disabled'. + */ + private AuthoringStatus authoringStatus; + + /** + * Creates an instance of UpdateAuthoringStatusRequest class. + */ + public UpdateAuthoringStatusRequest() { + } + + /** + * Get the authoringStatus property: The authoring status value to be updated. Possible values include: 'Authoring', + * 'ReadyForUse' and 'Disabled'. + * + * @return the authoringStatus value. + */ + public AuthoringStatus authoringStatus() { + return this.authoringStatus; + } + + /** + * Set the authoringStatus property: The authoring status value to be updated. Possible values include: 'Authoring', + * 'ReadyForUse' and 'Disabled'. + * + * @param authoringStatus the authoringStatus value to set. + * @return the UpdateAuthoringStatusRequest object itself. + */ + public UpdateAuthoringStatusRequest withAuthoringStatus(AuthoringStatus authoringStatus) { + this.authoringStatus = authoringStatus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authoringStatus() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property authoringStatus in model UpdateAuthoringStatusRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpdateAuthoringStatusRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("authoringStatus", + this.authoringStatus == null ? null : this.authoringStatus.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateAuthoringStatusRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateAuthoringStatusRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateAuthoringStatusRequest. + */ + public static UpdateAuthoringStatusRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateAuthoringStatusRequest deserializedUpdateAuthoringStatusRequest = new UpdateAuthoringStatusRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("authoringStatus".equals(fieldName)) { + deserializedUpdateAuthoringStatusRequest.authoringStatus + = AuthoringStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateAuthoringStatusRequest; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusResponse.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusResponse.java new file mode 100644 index 000000000000..9329931d4801 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UpdateAuthoringStatusResponse.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.sovereign.models; + +import com.azure.resourcemanager.sovereign.fluent.models.UpdateAuthoringStatusResponseInner; + +/** + * An immutable client-side representation of UpdateAuthoringStatusResponse. + */ +public interface UpdateAuthoringStatusResponse { + /** + * Gets the landingZoneConfigurationName property: The name of the landing zone configuration resource. + * + * @return the landingZoneConfigurationName value. + */ + String landingZoneConfigurationName(); + + /** + * Gets the authoringStatus property: The authoring status value to be updated. + * + * @return the authoringStatus value. + */ + AuthoringStatus authoringStatus(); + + /** + * Gets the inner com.azure.resourcemanager.sovereign.fluent.models.UpdateAuthoringStatusResponseInner object. + * + * @return the inner object. + */ + UpdateAuthoringStatusResponseInner innerModel(); +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentities.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentities.java new file mode 100644 index 000000000000..e9f237052ee2 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentities.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.sovereign.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * The UserAssignedIdentities model. + */ +@Immutable +public final class UserAssignedIdentities extends UserAssignedIdentity { + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /** + * Creates an instance of UserAssignedIdentities class. + */ + public UserAssignedIdentities() { + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + @Override + public UUID clientId() { + return this.clientId; + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + @Override + public UUID principalId() { + return this.principalId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentities from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentities if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentities. + */ + public static UserAssignedIdentities fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentities deserializedUserAssignedIdentities = new UserAssignedIdentities(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentities.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentities.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentities; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentity.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..d9355962d8a4 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/UserAssignedIdentity.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.sovereign.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.UUID; + +/** + * User assigned identity properties. + */ +@Immutable +public class UserAssignedIdentity implements JsonSerializable { + /* + * The principal ID of the assigned identity. + */ + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + private UUID clientId; + + /** + * Creates an instance of UserAssignedIdentity class. + */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID of the assigned identity. + * + * @param principalId the principalId value to set. + * @return the UserAssignedIdentity object itself. + */ + UserAssignedIdentity withPrincipalId(UUID principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client ID of the assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserAssignedIdentity object itself. + */ + UserAssignedIdentity withClientId(UUID clientId) { + this.clientId = clientId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/package-info.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/package-info.java new file mode 100644 index 000000000000..71d172b1ce0d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/models/package-info.java @@ -0,0 +1,9 @@ +// 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 MicrosoftSovereign. + * null. + */ +package com.azure.resourcemanager.sovereign.models; diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/package-info.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/package-info.java new file mode 100644 index 000000000000..9c3889b8d43f --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/com/azure/resourcemanager/sovereign/package-info.java @@ -0,0 +1,9 @@ +// 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 MicrosoftSovereign. + * null. + */ +package com.azure.resourcemanager.sovereign; diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/module-info.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/module-info.java new file mode 100644 index 000000000000..0066f9241929 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/java/module-info.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.sovereign { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.sovereign; + exports com.azure.resourcemanager.sovereign.fluent; + exports com.azure.resourcemanager.sovereign.fluent.models; + exports com.azure.resourcemanager.sovereign.models; + + opens com.azure.resourcemanager.sovereign.fluent.models to com.azure.core; + opens com.azure.resourcemanager.sovereign.models to com.azure.core; +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/proxy-config.json b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/proxy-config.json new file mode 100644 index 000000000000..23c9e8b56f90 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.sovereign.implementation.LandingZoneAccountOperationsClientImpl$LandingZoneAccountOperationsService"],["com.azure.resourcemanager.sovereign.implementation.LandingZoneConfigurationOperationsClientImpl$LandingZoneConfigurationOperationsService"],["com.azure.resourcemanager.sovereign.implementation.LandingZoneRegistrationOperationsClientImpl$LandingZoneRegistrationOperationsService"],["com.azure.resourcemanager.sovereign.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/reflect-config.json b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sovereign/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsCreateSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsCreateSamples.java new file mode 100644 index 000000000000..e8b47a5e8501 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsCreateSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourceProperties; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentity; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentityType; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LandingZoneAccountOperations Create. + */ +public final class LandingZoneAccountOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Create.json + */ + /** + * Sample code: LandingZoneAccountOperations_Create. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsCreate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .define("ExampleLZA") + .withRegion("northeurope") + .withExistingResourceGroup("SampleResourceGroup") + .withTags(mapOf("tag1", "MCFS")) + .withProperties(new LandingZoneAccountResourceProperties().withStorageAccount( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/TestStorageAccount/providers/Microsoft.Storage/storageAccounts/teststorageaccount")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsDeleteSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsDeleteSamples.java new file mode 100644 index 000000000000..dae5e93d7900 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneAccountOperations Delete. + */ +public final class LandingZoneAccountOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Delete.json + */ + /** + * Sample code: LandingZoneAccountOperations_Delete. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsDelete(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .delete("SampleResourceGroup", "SampleLZA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsGetByResourceGroupSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..eaf795f8353b --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsGetByResourceGroupSamples.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.sovereign.generated; + +/** + * Samples for LandingZoneAccountOperations GetByResourceGroup. + */ +public final class LandingZoneAccountOperationsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Get.json + */ + /** + * Sample code: LandingZoneAccountOperations_Get. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneAccountOperationsGet(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .getByResourceGroupWithResponse("SampleResourceGroup", "SampleLZA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListByResourceGroupSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..697780cb1afe --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneAccountOperations ListByResourceGroup. + */ +public final class LandingZoneAccountOperationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_ListByResourceGroup.json + */ + /** + * Sample code: LandingZoneAccountOperations_ListByResourceGroup_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneAccountOperationsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations() + .listByResourceGroup("SampleResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListSamples.java new file mode 100644 index 000000000000..d43bb6508615 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsListSamples.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.sovereign.generated; + +/** + * Samples for LandingZoneAccountOperations List. + */ +public final class LandingZoneAccountOperationsListSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_ListBySubscription.json + */ + /** + * Sample code: LandingZoneAccountOperations_ListBySubscription. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsListBySubscription(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneAccountOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsUpdateSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsUpdateSamples.java new file mode 100644 index 000000000000..c524f9d896a2 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneAccountOperationsUpdateSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.AzureResourceManagerCommonTypesManagedServiceIdentityUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneAccountResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedServiceIdentityType; + +/** + * Samples for LandingZoneAccountOperations Update. + */ +public final class LandingZoneAccountOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneAccountOperations_Update.json + */ + /** + * Sample code: LandingZoneAccountOperations_Update. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneAccountOperationsUpdate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + LandingZoneAccountResource resource = manager.landingZoneAccountOperations() + .getByResourceGroupWithResponse("ExampleResourceGroup", "ExampleLZA", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new LandingZoneAccountResourcePropertiesUpdate().withStorageAccount( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/TestStorageAccount/providers/Microsoft.Storage/storageAccounts/teststcontainer")) + .withIdentity(new AzureResourceManagerCommonTypesManagedServiceIdentityUpdate() + .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .apply(); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateCopySamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateCopySamples.java new file mode 100644 index 000000000000..e972a6b45112 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateCopySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.CreateLandingZoneConfigurationCopyRequest; + +/** + * Samples for LandingZoneConfigurationOperations CreateCopy. + */ +public final class LandingZoneConfigurationOperationsCreateCopySamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_CreateCopy.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_CreateCopy. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsCreateCopy(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .createCopy("ExampleResourceGroup", "SampleLZA", "ExampleLZC", + new CreateLandingZoneConfigurationCopyRequest().withName("LandingZoneConfiguration"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateSamples.java new file mode 100644 index 000000000000..fe145fb84c41 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsCreateSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.CustomNamingConvention; +import com.azure.resourcemanager.sovereign.models.DecommissionedManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.FirewallCreationOptions; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourceProperties; +import com.azure.resourcemanager.sovereign.models.LandingZoneManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; +import com.azure.resourcemanager.sovereign.models.ManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.PlatformManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.PolicyInitiativeAssignmentProperties; +import com.azure.resourcemanager.sovereign.models.ResourceCreationOptions; +import com.azure.resourcemanager.sovereign.models.ResourceType; +import com.azure.resourcemanager.sovereign.models.SandboxManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.Tags; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LandingZoneConfigurationOperations Create. + */ +public final class LandingZoneConfigurationOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Create.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Create. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsCreate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .define("ExampleLZC") + .withExistingLandingZoneAccount("ExampleResourceGroup", "ExampleLZA") + .withProperties(new LandingZoneConfigurationResourceProperties() + .withDdosProtectionCreationOption(ResourceCreationOptions.YES) + .withLogAnalyticsWorkspaceCreationOption(ResourceCreationOptions.NO) + .withTags(Arrays.asList(new Tags().withName("tag1").withValue("do"), + new Tags().withName("tag2").withValue("do"))) + .withFirewallCreationOption(FirewallCreationOptions.STANDARD) + .withFirewallSubnetCidrBlock("10.20.255.0/24") + .withGatewaySubnetCidrBlock("10.20.255.0/24") + .withLogRetentionInDays(540L) + .withHubNetworkCidrBlock("10.20.255.0/24") + .withAzureBastionCreationOption(ResourceCreationOptions.YES) + .withAzureBastionSubnetCidrBlock("10.20.255.0/24") + .withLandingZonesMgChildren(Arrays.asList(new LandingZoneManagementGroupProperties() + .withPolicyInitiativesAssignmentProperties(Arrays.asList(new PolicyInitiativeAssignmentProperties() + .withPolicyInitiativeId("c138fd1a-e08f-4318-9490-d11ef2c2f9c1") + .withAssignmentParameters(mapOf()))) + .withName("Corp"))) + .withTopLevelMgMetadata(new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties( + Arrays.asList(new PolicyInitiativeAssignmentProperties().withPolicyInitiativeId( + "/providers/Microsoft.Authorization/policySetDefinitions/0a2ebd47-3fb9-4735-a006-b7f31ddadd9f") + .withAssignmentParameters(mapOf("Effect", "Audit"))))) + .withLandingZonesMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformManagementMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformConnectivityMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformIdentityMgMetadata( + new ManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withDecommissionedMgMetadata(new DecommissionedManagementGroupProperties() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(false)) + .withSandboxMgMetadata( + new SandboxManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(true)) + .withManagedIdentity( + new ManagedIdentityProperties().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED)) + .withPlatformMgChildren(Arrays.asList( + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg1"), + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg2"))) + .withNamingConventionFormula("{ResourceTypeAbbreviation}") + .withCustomNamingConvention( + Arrays.asList(new CustomNamingConvention().withResourceType(ResourceType.AZURE_FIREWALLS) + .withFormula("{DeploymentSuffix}")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsDeleteSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsDeleteSamples.java new file mode 100644 index 000000000000..e0881c417081 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneConfigurationOperations Delete. + */ +public final class LandingZoneConfigurationOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Delete.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Delete. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsDelete(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .delete("ExampleResourceGroup", "SampleLZA", "ExampleLZC", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGenerateLandingZoneSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGenerateLandingZoneSamples.java new file mode 100644 index 000000000000..afd296c828a7 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGenerateLandingZoneSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.GenerateLandingZoneRequest; +import com.azure.resourcemanager.sovereign.models.InfrastructureAsCodeOutputOptions; + +/** + * Samples for LandingZoneConfigurationOperations GenerateLandingZone. + */ +public final class LandingZoneConfigurationOperationsGenerateLandingZoneSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_GenerateLandingZone.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_GenerateLandingZone. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsGenerateLandingZone( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .generateLandingZone("ExampleResourceGroup", "SampleLZA", "ExampleLZC", + new GenerateLandingZoneRequest() + .withInfrastructureAsCodeOutputOptions(InfrastructureAsCodeOutputOptions.BICEP) + .withExistingManagementSubscriptionId("/subscriptions/00000000-0000-0000-0000-000000000001") + .withExistingIdentitySubscriptionId("/subscriptions/00000000-0000-0000-0000-000000000002") + .withExistingConnectivitySubscriptionId("/subscriptions/00000000-0000-0000-0000-000000000003") + .withDeploymentPrefix("mcfs") + .withDeploymentSuffix("test") + .withTopLevelMgDisplayName("TestMG") + .withDeploymentLocation("eastus") + .withOrganization("test") + .withEnvironment("QA"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGetSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGetSamples.java new file mode 100644 index 000000000000..8a47e4056e9d --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneConfigurationOperations Get. + */ +public final class LandingZoneConfigurationOperationsGetSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Get.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Get. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsGet(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .getWithResponse("rgsovereign", "SampleLZA", "SampleLZC", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListByResourceGroupSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..d03c496f3b86 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneConfigurationOperations ListByResourceGroup. + */ +public final class LandingZoneConfigurationOperationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_ListByResourceGroup.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_ListByResourceGroup. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsListByResourceGroup( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .listByResourceGroup("ExampleResourceGroup", "ExampleLZA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListBySubscriptionSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListBySubscriptionSamples.java new file mode 100644 index 000000000000..b1f1ab0c0696 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsListBySubscriptionSamples.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.sovereign.generated; + +/** + * Samples for LandingZoneConfigurationOperations ListBySubscription. + */ +public final class LandingZoneConfigurationOperationsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_ListBySubscription.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_ListBySubscription. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsListBySubscription( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations().listBySubscription("ExampleLZA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateAuthoringStatusSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateAuthoringStatusSamples.java new file mode 100644 index 000000000000..43bcebcf3bfd --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateAuthoringStatusSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.AuthoringStatus; +import com.azure.resourcemanager.sovereign.models.UpdateAuthoringStatusRequest; + +/** + * Samples for LandingZoneConfigurationOperations UpdateAuthoringStatus. + */ +public final class LandingZoneConfigurationOperationsUpdateAuthoringStatusSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_UpdateAuthoringStatus.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_UpdateAuthoringStatus. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneConfigurationOperationsUpdateAuthoringStatus( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneConfigurationOperations() + .updateAuthoringStatus("ExampleResourceGroup", "ExampleLZA", "ExampleLZC", + new UpdateAuthoringStatusRequest().withAuthoringStatus(AuthoringStatus.AUTHORING), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateSamples.java new file mode 100644 index 000000000000..3f6f8f02c288 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneConfigurationOperationsUpdateSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.CustomNamingConvention; +import com.azure.resourcemanager.sovereign.models.DecommissionedManagementGroupPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.FirewallCreationOptions; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneConfigurationResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.LandingZoneManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; +import com.azure.resourcemanager.sovereign.models.ManagementGroupPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.PlatformManagementGroupProperties; +import com.azure.resourcemanager.sovereign.models.PolicyInitiativeAssignmentProperties; +import com.azure.resourcemanager.sovereign.models.ResourceCreationOptions; +import com.azure.resourcemanager.sovereign.models.ResourceType; +import com.azure.resourcemanager.sovereign.models.SandboxManagementGroupPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.Tags; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for LandingZoneConfigurationOperations Update. + */ +public final class LandingZoneConfigurationOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneConfigurationOperations_Update.json + */ + /** + * Sample code: LandingZoneConfigurationOperations_Update. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneConfigurationOperationsUpdate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + LandingZoneConfigurationResource resource = manager.landingZoneConfigurationOperations() + .getWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZC", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new LandingZoneConfigurationResourcePropertiesUpdate() + .withDdosProtectionCreationOption(ResourceCreationOptions.YES) + .withLogAnalyticsWorkspaceCreationOption(ResourceCreationOptions.NO) + .withTags(Arrays.asList(new Tags().withName("tag1").withValue("do"), + new Tags().withName("tag2").withValue("do"))) + .withFirewallCreationOption(FirewallCreationOptions.STANDARD) + .withFirewallSubnetCidrBlock("10.20.255.0/24") + .withGatewaySubnetCidrBlock("10.20.255.0/24") + .withLogRetentionInDays(540L) + .withHubNetworkCidrBlock("10.20.255.0/24") + .withAzureBastionCreationOption(ResourceCreationOptions.YES) + .withAzureBastionSubnetCidrBlock("10.20.255.0/24") + .withLandingZonesMgChildren(Arrays.asList(new LandingZoneManagementGroupProperties() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("Corp"))) + .withTopLevelMgMetadata(new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties( + Arrays.asList(new PolicyInitiativeAssignmentProperties().withPolicyInitiativeId( + "/providers/Microsoft.Authorization/policySetDefinitions/0a2ebd47-3fb9-4735-a006-b7f31ddadd9f") + .withAssignmentParameters(mapOf("Effect", "Audit"))))) + .withLandingZonesMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformManagementMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformConnectivityMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withPlatformIdentityMgMetadata( + new ManagementGroupPropertiesUpdate().withPolicyInitiativesAssignmentProperties(Arrays.asList())) + .withDecommissionedMgMetadata(new DecommissionedManagementGroupPropertiesUpdate() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(false)) + .withSandboxMgMetadata(new SandboxManagementGroupPropertiesUpdate() + .withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withCreate(true)) + .withManagedIdentity( + new ManagedIdentityPropertiesUpdate().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED)) + .withPlatformMgChildren(Arrays.asList( + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg1"), + new PlatformManagementGroupProperties().withPolicyInitiativesAssignmentProperties(Arrays.asList()) + .withName("childmg2"))) + .withNamingConventionFormula("{ResourceTypeAbbreviation}") + .withCustomNamingConvention( + Arrays.asList(new CustomNamingConvention().withResourceType(ResourceType.AZURE_FIREWALLS) + .withFormula("{DeploymentSuffix}")))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsCreateSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsCreateSamples.java new file mode 100644 index 000000000000..ba7b74b478f1 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsCreateSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourceProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityProperties; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; + +/** + * Samples for LandingZoneRegistrationOperations Create. + */ +public final class LandingZoneRegistrationOperationsCreateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Create.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Create. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsCreate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .define("ExampleLZR") + .withExistingLandingZoneAccount("ExampleResourceGroup", "ExampleLZA") + .withProperties(new LandingZoneRegistrationResourceProperties() + .withExistingTopLevelMgId("/providers/Microsoft.Management/managementGroups/mcfs") + .withExistingLandingZoneConfigurationId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/TestResourceGroup/providers/Microsoft.Sovereign/landingZoneAccounts/ExampleLZA/landingZoneConfigurations/ExampleLZC") + .withManagedIdentity( + new ManagedIdentityProperties().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED))) + .create(); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsDeleteSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsDeleteSamples.java new file mode 100644 index 000000000000..5bc7c6146a79 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneRegistrationOperations Delete. + */ +public final class LandingZoneRegistrationOperationsDeleteSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Delete.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Delete. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsDelete(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .deleteWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZR", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsGetSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsGetSamples.java new file mode 100644 index 000000000000..82686ebca713 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneRegistrationOperations Get. + */ +public final class LandingZoneRegistrationOperationsGetSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Get.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Get. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsGet(com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .getWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZR", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListByResourceGroupSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..b8c0d34bc426 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListByResourceGroupSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sovereign.generated; + +/** + * Samples for LandingZoneRegistrationOperations ListByResourceGroup. + */ +public final class LandingZoneRegistrationOperationsListByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_ListByResourceGroup.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_ListByResourceGroup. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneRegistrationOperationsListByResourceGroup( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations() + .listByResourceGroup("ExampleResourceGroup", "ExampleLZA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListBySubscriptionSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListBySubscriptionSamples.java new file mode 100644 index 000000000000..b5577481e28f --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsListBySubscriptionSamples.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.sovereign.generated; + +/** + * Samples for LandingZoneRegistrationOperations ListBySubscription. + */ +public final class LandingZoneRegistrationOperationsListBySubscriptionSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_ListBySubscription.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_ListBySubscription. + * + * @param manager Entry point to SovereignManager. + */ + public static void landingZoneRegistrationOperationsListBySubscription( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.landingZoneRegistrationOperations().listBySubscription("ExampleLZA", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsUpdateSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsUpdateSamples.java new file mode 100644 index 000000000000..821a32d24b02 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/LandingZoneRegistrationOperationsUpdateSamples.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.sovereign.generated; + +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResource; +import com.azure.resourcemanager.sovereign.models.LandingZoneRegistrationResourcePropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityPropertiesUpdate; +import com.azure.resourcemanager.sovereign.models.ManagedIdentityResourceType; + +/** + * Samples for LandingZoneRegistrationOperations Update. + */ +public final class LandingZoneRegistrationOperationsUpdateSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/ + * LandingZoneRegistrationOperations_Update.json + */ + /** + * Sample code: LandingZoneRegistrationOperations_Update. + * + * @param manager Entry point to SovereignManager. + */ + public static void + landingZoneRegistrationOperationsUpdate(com.azure.resourcemanager.sovereign.SovereignManager manager) { + LandingZoneRegistrationResource resource = manager.landingZoneRegistrationOperations() + .getWithResponse("ExampleResourceGroup", "ExampleLZA", "ExampleLZR", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new LandingZoneRegistrationResourcePropertiesUpdate() + .withExistingTopLevelMgId("/providers/Microsoft.Management/managementGroups/mcfs") + .withExistingLandingZoneConfigurationId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/TestResourceGroup/providers/Microsoft.Sovereign/landingZoneAccounts/ExampleLZA/landingZoneConfigurations/ExampleLZC") + .withManagedIdentity( + new ManagedIdentityPropertiesUpdate().withType(ManagedIdentityResourceType.SYSTEM_ASSIGNED))) + .apply(); + } +} diff --git a/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/OperationsListSamples.java b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/OperationsListSamples.java new file mode 100644 index 000000000000..350c7d311f53 --- /dev/null +++ b/sdk/sovereign/azure-resourcemanager-sovereign/src/samples/java/com/azure/resourcemanager/sovereign/generated/OperationsListSamples.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.sovereign.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: + * specification/sovereign/resource-manager/Microsoft.Sovereign/preview/2025-02-27-preview/examples/Operations_List. + * json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen - generated by [MaximumSet] rule. + * + * @param manager Entry point to SovereignManager. + */ + public static void operationsListMaximumSetGenGeneratedByMaximumSetRule( + com.azure.resourcemanager.sovereign.SovereignManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sovereign/ci.yml b/sdk/sovereign/ci.yml new file mode 100644 index 000000000000..6266a45ce137 --- /dev/null +++ b/sdk/sovereign/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/sovereign/ci.yml + - sdk/sovereign/azure-resourcemanager-sovereign/ + exclude: + - sdk/sovereign/pom.xml + - sdk/sovereign/azure-resourcemanager-sovereign/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sovereign/ci.yml + - sdk/sovereign/azure-resourcemanager-sovereign/ + exclude: + - sdk/sovereign/pom.xml + - sdk/sovereign/azure-resourcemanager-sovereign/pom.xml + +parameters: + - name: release_azureresourcemanagersovereign + displayName: azure-resourcemanager-sovereign + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: sovereign + Artifacts: + - name: azure-resourcemanager-sovereign + groupId: com.azure.resourcemanager + safeName: azureresourcemanagersovereign + releaseInBatch: ${{ parameters.release_azureresourcemanagersovereign }} diff --git a/sdk/sovereign/pom.xml b/sdk/sovereign/pom.xml new file mode 100644 index 000000000000..1501d6e375ba --- /dev/null +++ b/sdk/sovereign/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-sovereign-service + pom + 1.0.0 + + + azure-resourcemanager-sovereign + +