From c7cd54bdc5ce530c502038c81fad1c8048fef3a0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 12 Apr 2023 17:25:19 +0000 Subject: [PATCH] CodeGen from PR 23292 in Azure/azure-rest-api-specs Merge ebe59c92d393d8ad56343995fc588b84584ed14e into 4637adf8aac277915fad37135dc4d11d34e166b9 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 105 + .../SAMPLE.md | 981 ++ .../pom.xml | 61 + .../resources/generated/ResourceManager.java | 394 + .../fluent/DeploymentOperationsClient.java | 301 + .../generated/fluent/DeploymentsClient.java | 2064 ++++ .../generated/fluent/OperationsClient.java | 38 + .../fluent/ProviderResourceTypesClient.java | 42 + .../generated/fluent/ProvidersClient.java | 231 + .../fluent/ResourceGroupsClient.java | 283 + .../fluent/ResourceManagementClient.java | 102 + .../generated/fluent/ResourcesClient.java | 935 ++ .../generated/fluent/TagOperationsClient.java | 401 + .../models/DeploymentExportResultInner.java | 50 + .../models/DeploymentExtendedInner.java | 70 + .../models/DeploymentOperationInner.java | 84 + .../models/DeploymentValidateResultInner.java | 74 + .../models/GenericResourceExpandedInner.java | 143 + .../fluent/models/GenericResourceInner.java | 238 + .../fluent/models/OperationInner.java | 80 + .../fluent/models/ProviderInner.java | 143 + .../ProviderPermissionListResultInner.java | 70 + .../ProviderResourceTypeListResultInner.java | 70 + .../ResourceGroupExportResultInner.java | 83 + .../fluent/models/ResourceGroupInner.java | 96 + .../fluent/models/TagDetailsInner.java | 128 + .../fluent/models/TagValueInner.java | 95 + .../fluent/models/TagsResourceInner.java | 62 + .../models/TemplateHashResultInner.java | 76 + .../models/WhatIfOperationProperties.java | 55 + .../models/WhatIfOperationResultInner.java | 129 + .../generated/fluent/models/package-info.java | 9 + .../generated/fluent/package-info.java | 9 + .../DeploymentExportResultImpl.java | 33 + .../DeploymentExtendedImpl.java | 232 + .../DeploymentOperationImpl.java | 42 + .../DeploymentOperationsClientImpl.java | 2261 ++++ .../DeploymentOperationsImpl.java | 220 + .../DeploymentValidateResultImpl.java | 39 + .../implementation/DeploymentsClientImpl.java | 9772 +++++++++++++++++ .../implementation/DeploymentsImpl.java | 836 ++ .../GenericResourceExpandedImpl.java | 101 + .../implementation/GenericResourceImpl.java | 88 + .../implementation/OperationImpl.java | 37 + .../implementation/OperationsClientImpl.java | 276 + .../implementation/OperationsImpl.java | 45 + .../implementation/ProviderImpl.java | 61 + .../ProviderPermissionListResultImpl.java | 45 + .../ProviderResourceTypeListResultImpl.java | 45 + .../ProviderResourceTypesClientImpl.java | 213 + .../ProviderResourceTypesImpl.java | 61 + .../implementation/ProvidersClientImpl.java | 1478 +++ .../implementation/ProvidersImpl.java | 188 + .../ResourceGroupExportResultImpl.java | 38 + .../implementation/ResourceGroupImpl.java | 206 + .../ResourceGroupsClientImpl.java | 1544 +++ .../implementation/ResourceGroupsImpl.java | 162 + .../ResourceManagementClientBuilder.java | 144 + .../ResourceManagementClientImpl.java | 388 + .../implementation/ResourcesClientImpl.java | 4493 ++++++++ .../implementation/ResourcesImpl.java | 394 + .../implementation/TagDetailsImpl.java | 60 + .../TagOperationsClientImpl.java | 1812 +++ .../implementation/TagOperationsImpl.java | 179 + .../implementation/TagValueImpl.java | 41 + .../implementation/TagsResourceImpl.java | 45 + .../TemplateHashResultImpl.java | 37 + .../generated/implementation/Utils.java | 204 + .../WhatIfOperationResultImpl.java | 50 + .../implementation/package-info.java | 9 + .../resources/generated/models/Alias.java | 180 + .../resources/generated/models/AliasPath.java | 125 + .../generated/models/AliasPathAttributes.java | 47 + .../generated/models/AliasPathMetadata.java | 54 + .../generated/models/AliasPathTokenType.java | 65 + .../generated/models/AliasPattern.java | 102 + .../generated/models/AliasPatternType.java | 51 + .../resources/generated/models/AliasType.java | 54 + .../generated/models/ApiProfile.java | 54 + .../generated/models/BasicDependency.java | 102 + .../generated/models/ChangeType.java | 66 + .../generated/models/DebugSetting.java | 62 + .../generated/models/Dependency.java | 132 + .../generated/models/Deployment.java | 115 + .../models/DeploymentExportResult.java | 24 + .../generated/models/DeploymentExtended.java | 323 + .../models/DeploymentListResult.java | 70 + .../generated/models/DeploymentMode.java | 56 + .../generated/models/DeploymentOperation.java | 38 + .../models/DeploymentOperationProperties.java | 191 + .../models/DeploymentOperations.java | 276 + .../DeploymentOperationsListResult.java | 70 + .../models/DeploymentProperties.java | 292 + .../models/DeploymentPropertiesExtended.java | 311 + .../models/DeploymentValidateResult.java | 34 + .../generated/models/DeploymentWhatIf.java | 86 + .../models/DeploymentWhatIfProperties.java | 112 + .../models/DeploymentWhatIfSettings.java | 50 + .../generated/models/Deployments.java | 1325 +++ .../models/ExportTemplateRequest.java | 85 + .../models/ExpressionEvaluationOptions.java | 52 + .../ExpressionEvaluationOptionsScopeType.java | 51 + .../generated/models/ExtendedLocation.java | 76 + .../models/ExtendedLocationType.java | 44 + .../generated/models/GenericResource.java | 102 + .../models/GenericResourceExpanded.java | 127 + .../generated/models/HttpMessage.java | 50 + .../resources/generated/models/Identity.java | 126 + .../IdentityUserAssignedIdentitiesValue.java | 54 + .../generated/models/OnErrorDeployment.java | 78 + .../models/OnErrorDeploymentExtended.java | 93 + .../models/OnErrorDeploymentType.java | 51 + .../resources/generated/models/Operation.java | 31 + .../generated/models/OperationDisplay.java | 128 + .../generated/models/OperationListResult.java | 84 + .../generated/models/Operations.java | 33 + .../generated/models/ParametersLink.java | 84 + .../generated/models/Permission.java | 129 + .../resources/generated/models/Plan.java | 154 + .../generated/models/PropertyChangeType.java | 60 + .../resources/generated/models/Provider.java | 60 + .../ProviderAuthorizationConsentState.java | 53 + .../models/ProviderConsentDefinition.java | 50 + .../models/ProviderExtendedLocation.java | 103 + .../generated/models/ProviderListResult.java | 70 + .../generated/models/ProviderPermission.java | 135 + .../models/ProviderPermissionListResult.java | 33 + .../models/ProviderRegistrationRequest.java | 54 + .../models/ProviderResourceType.java | 278 + .../ProviderResourceTypeListResult.java | 33 + .../models/ProviderResourceTypes.java | 37 + .../resources/generated/models/Providers.java | 209 + .../models/ProvisioningOperation.java | 75 + .../generated/models/ProvisioningState.java | 77 + .../generated/models/ResourceGroup.java | 267 + .../models/ResourceGroupExportResult.java | 34 + .../models/ResourceGroupListResult.java | 70 + .../models/ResourceGroupPatchable.java | 134 + .../models/ResourceGroupProperties.java | 39 + .../generated/models/ResourceGroups.java | 196 + .../models/ResourceIdentityType.java | 57 + .../generated/models/ResourceListResult.java | 70 + .../generated/models/ResourceReference.java | 39 + .../resources/generated/models/Resources.java | 562 + .../generated/models/ResourcesMoveInfo.java | 77 + .../generated/models/RoleDefinition.java | 158 + .../generated/models/ScopedDeployment.java | 120 + .../models/ScopedDeploymentWhatIf.java | 92 + .../resources/generated/models/Sku.java | 180 + .../generated/models/StatusMessage.java | 83 + .../resources/generated/models/TagCount.java | 76 + .../generated/models/TagDetails.java | 47 + .../generated/models/TagOperations.java | 275 + .../resources/generated/models/TagValue.java | 38 + .../resources/generated/models/Tags.java | 53 + .../generated/models/TagsListResult.java | 70 + .../generated/models/TagsPatchOperation.java | 50 + .../generated/models/TagsPatchResource.java | 79 + .../generated/models/TagsResource.java | 45 + .../generated/models/TargetResource.java | 102 + .../generated/models/TemplateHashResult.java | 31 + .../generated/models/TemplateLink.java | 162 + .../generated/models/WhatIfChange.java | 197 + .../models/WhatIfOperationResult.java | 42 + .../models/WhatIfPropertyChange.java | 172 + .../generated/models/WhatIfResultFormat.java | 51 + .../generated/models/ZoneMapping.java | 77 + .../generated/models/package-info.java | 9 + .../resources/generated/package-info.java | 9 + .../src/main/java/module-info.java | 19 + ...ploymentsCalculateTemplateHashSamples.java | 35 + ...OrUpdateAtManagementGroupScopeSamples.java | 44 + ...ploymentsCreateOrUpdateAtScopeSamples.java | 58 + ...ateOrUpdateAtSubscriptionScopeSamples.java | 46 + ...ntsCreateOrUpdateAtTenantScopeSamples.java | 57 + .../DeploymentsCreateOrUpdateSamples.java | 129 + ...tsWhatIfAtManagementGroupScopeSamples.java | 44 + ...mentsWhatIfAtSubscriptionScopeSamples.java | 43 + ...DeploymentsWhatIfAtTenantScopeSamples.java | 43 + .../generated/DeploymentsWhatIfSamples.java | 43 + .../ProviderResourceTypesListSamples.java | 20 + .../ProvidersGetAtTenantScopeSamples.java | 24 + .../generated/ProvidersGetSamples.java | 20 + .../generated/ProvidersListSamples.java | 20 + .../ProvidersProviderPermissionsSamples.java | 20 + .../ResourceGroupsCreateOrUpdateSamples.java | 21 + .../ResourceGroupsDeleteSamples.java | 41 + .../ResourceGroupsExportTemplateSamples.java | 53 + ...perationsCreateOrUpdateAtScopeSamples.java | 61 + .../TagOperationsDeleteAtScopeSamples.java | 39 + .../TagOperationsGetAtScopeSamples.java | 39 + .../TagOperationsUpdateAtScopeSamples.java | 64 + sdk/resources/ci.yml | 47 + sdk/resources/pom.xml | 15 + 197 files changed, 45822 insertions(+) create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/CHANGELOG.md create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/README.md create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/SAMPLE.md create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/pom.xml create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/ResourceManager.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentOperationsClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentsClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/OperationsClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProviderResourceTypesClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProvidersClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceGroupsClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceManagementClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourcesClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/TagOperationsClient.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExportResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExtendedInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentOperationInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentValidateResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceExpandedInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/OperationInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderPermissionListResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderResourceTypeListResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupExportResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagDetailsInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagValueInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagsResourceInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TemplateHashResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationProperties.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationResultInner.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/package-info.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/package-info.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExportResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExtendedImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentValidateResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceExpandedImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderPermissionListResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypeListResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupExportResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientBuilder.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagDetailsImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsClientImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagValueImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagsResourceImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TemplateHashResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/Utils.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/WhatIfOperationResultImpl.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/package-info.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Alias.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPath.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathAttributes.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathMetadata.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathTokenType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPattern.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPatternType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ApiProfile.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/BasicDependency.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ChangeType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DebugSetting.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Dependency.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployment.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExportResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExtended.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentMode.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperation.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationProperties.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperations.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationsListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentProperties.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentPropertiesExtended.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentValidateResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIf.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfProperties.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfSettings.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployments.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExportTemplateRequest.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptions.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptionsScopeType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocation.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocationType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResource.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResourceExpanded.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/HttpMessage.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Identity.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/IdentityUserAssignedIdentitiesValue.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeployment.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentExtended.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operation.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationDisplay.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operations.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ParametersLink.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Permission.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Plan.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/PropertyChangeType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Provider.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderAuthorizationConsentState.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderConsentDefinition.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderExtendedLocation.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermission.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermissionListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderRegistrationRequest.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypeListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypes.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Providers.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningOperation.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningState.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroup.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupExportResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupPatchable.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupProperties.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroups.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceIdentityType.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceReference.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Resources.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourcesMoveInfo.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/RoleDefinition.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeployment.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeploymentWhatIf.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Sku.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/StatusMessage.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagCount.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagDetails.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagOperations.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagValue.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Tags.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsListResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchOperation.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchResource.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsResource.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TargetResource.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateHashResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateLink.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfChange.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfOperationResult.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfPropertyChange.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfResultFormat.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ZoneMapping.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/package-info.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/package-info.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/main/java/module-info.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCalculateTemplateHashSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtTenantScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProviderResourceTypesListSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetAtTenantScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersListSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersProviderPermissionsSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsCreateOrUpdateSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsDeleteSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsExportTemplateSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsCreateOrUpdateAtScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsDeleteAtScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsGetAtScopeSamples.java create mode 100644 sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsUpdateAtScopeSamples.java create mode 100644 sdk/resources/ci.yml create mode 100644 sdk/resources/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b1c4bd57a1c85..0674d45a7d419 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -405,6 +405,7 @@ com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-resources-generated;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-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index fd55e080bba57..e6daa455c291e 100644 --- a/pom.xml +++ b/pom.xml @@ -151,6 +151,7 @@ sdk/resourcehealth sdk/resourcemanager sdk/resourcemover + sdk/resources sdk/schemaregistry sdk/scvmm sdk/search diff --git a/sdk/resources/azure-resourcemanager-resources-generated/CHANGELOG.md b/sdk/resources/azure-resourcemanager-resources-generated/CHANGELOG.md new file mode 100644 index 0000000000000..ed6527833a213 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-04-12) + +- Azure Resource Manager Resource client library for Java. This package contains Microsoft Azure SDK for Resource Management SDK. Provides operations for working with resources and resource groups. Package tag package-resources-2022-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/resources/azure-resourcemanager-resources-generated/README.md b/sdk/resources/azure-resourcemanager-resources-generated/README.md new file mode 100644 index 0000000000000..bcc5abe8523b8 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/README.md @@ -0,0 +1,105 @@ +# Azure Resource Manager Resource client library for Java + +Azure Resource Manager Resource client library for Java. + +This package contains Microsoft Azure SDK for Resource Management SDK. Provides operations for working with resources and resource groups. Package tag package-resources-2022-09. 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-resources-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-resources-generated + 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 + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ResourceManager manager = ResourceManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resources/azure-resourcemanager-resources-generated/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://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[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/resources/azure-resourcemanager-resources-generated/SAMPLE.md b/sdk/resources/azure-resourcemanager-resources-generated/SAMPLE.md new file mode 100644 index 0000000000000..585da3a7f3f7d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/SAMPLE.md @@ -0,0 +1,981 @@ +# Code snippets and samples + + +## Deployments + +- [CalculateTemplateHash](#deployments_calculatetemplatehash) +- [CreateOrUpdate](#deployments_createorupdate) +- [CreateOrUpdateAtManagementGroupScope](#deployments_createorupdateatmanagementgroupscope) +- [CreateOrUpdateAtScope](#deployments_createorupdateatscope) +- [CreateOrUpdateAtSubscriptionScope](#deployments_createorupdateatsubscriptionscope) +- [CreateOrUpdateAtTenantScope](#deployments_createorupdateattenantscope) +- [WhatIf](#deployments_whatif) +- [WhatIfAtManagementGroupScope](#deployments_whatifatmanagementgroupscope) +- [WhatIfAtSubscriptionScope](#deployments_whatifatsubscriptionscope) +- [WhatIfAtTenantScope](#deployments_whatifattenantscope) + +## ProviderResourceTypes + +- [List](#providerresourcetypes_list) + +## Providers + +- [Get](#providers_get) +- [GetAtTenantScope](#providers_getattenantscope) +- [List](#providers_list) +- [ProviderPermissions](#providers_providerpermissions) + +## ResourceGroups + +- [CreateOrUpdate](#resourcegroups_createorupdate) +- [Delete](#resourcegroups_delete) +- [ExportTemplate](#resourcegroups_exporttemplate) + +## TagOperations + +- [CreateOrUpdateAtScope](#tagoperations_createorupdateatscope) +- [DeleteAtScope](#tagoperations_deleteatscope) +- [GetAtScope](#tagoperations_getatscope) +- [UpdateAtScope](#tagoperations_updateatscope) +### Deployments_CalculateTemplateHash + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for Deployments CalculateTemplateHash. */ +public final class DeploymentsCalculateTemplateHashSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/CalculateTemplateHash.json + */ + /** + * Sample code: Calculate template hash. + * + * @param manager Entry point to ResourceManager. + */ + public static void calculateTemplateHash(com.azure.resourcemanager.resources.generated.ResourceManager manager) + throws IOException { + manager + .deployments() + .calculateTemplateHashWithResponse( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview\",\"contentVersion\":\"1.0.0.0\",\"outputs\":{\"string\":{\"type\":\"string\",\"value\":\"myvalue\"}},\"parameters\":{\"string\":{\"type\":\"string\"}},\"resources\":[],\"variables\":{\"array\":[1,2,3,4],\"bool\":true,\"int\":42,\"object\":{\"object\":{\"location\":\"West" + + " US\",\"vmSize\":\"Large\"}},\"string\":\"string\"}}", + Object.class, + SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.OnErrorDeployment; +import com.azure.resourcemanager.resources.generated.models.OnErrorDeploymentType; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments CreateOrUpdate. */ +public final class DeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentResourceGroup.json + */ + /** + * Sample code: Create a deployment that will deploy a template with a uri and queryString. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateWithAUriAndQueryString( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink( + new TemplateLink() + .withUri("https://example.com/exampleTemplate.json") + .withQueryString( + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .create(); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ + /** + * Sample code: Create a deployment that will deploy a templateSpec with the given resourceId. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink( + new TemplateLink() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .create(); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ + /** + * Sample code: Create a deployment that will redeploy another deployment on failure. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillRedeployAnotherDeploymentOnFailure( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.COMPLETE) + .withOnErrorDeployment( + new OnErrorDeployment() + .withType(OnErrorDeploymentType.SPECIFIC_DEPLOYMENT) + .withDeploymentName("name-of-deployment-to-use"))) + .create(); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ + /** + * Sample code: Create a deployment that will redeploy the last successful deployment on failure. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.COMPLETE) + .withOnErrorDeployment(new OnErrorDeployment().withType(OnErrorDeploymentType.LAST_SUCCESSFUL))) + .create(); + } +} +``` + +### Deployments_CreateOrUpdateAtManagementGroupScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments CreateOrUpdateAtManagementGroupScope. */ +public final class DeploymentsCreateOrUpdateAtManagementGroupScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtManagementGroup.json + */ + /** + * Sample code: Create deployment at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtManagementGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtManagementGroupScope( + "my-management-group-id", + "my-deployment", + new ScopedDeployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_CreateOrUpdateAtScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Deployments CreateOrUpdateAtScope. */ +public final class DeploymentsCreateOrUpdateAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtScope.json + */ + /** + * Sample code: Create deployment at a given scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtAGivenScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtScope( + "providers/Microsoft.Management/managementGroups/my-management-group-id", + "my-deployment", + new Deployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Deployments_CreateOrUpdateAtSubscriptionScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments CreateOrUpdateAtSubscriptionScope. */ +public final class DeploymentsCreateOrUpdateAtSubscriptionScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ + /** + * Sample code: Create a deployment that will deploy a templateSpec with the given resourceId. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtSubscriptionScope( + "my-deployment", + new Deployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink( + new TemplateLink() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_CreateOrUpdateAtTenantScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Deployments CreateOrUpdateAtTenantScope. */ +public final class DeploymentsCreateOrUpdateAtTenantScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtTenant.json + */ + /** + * Sample code: Create deployment at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtTenantScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtTenantScope( + "tenant-dep01", + new ScopedDeployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Deployments_WhatIf + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIf. */ +public final class DeploymentsWhatIfSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnResourceGroup.json + */ + /** + * Sample code: Predict template changes at resource group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtResourceGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIf( + "my-resource-group", + "my-deployment", + new DeploymentWhatIf() + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_WhatIfAtManagementGroupScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIfAtManagementGroupScope. */ +public final class DeploymentsWhatIfAtManagementGroupScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnManagementGroup.json + */ + /** + * Sample code: Predict template changes at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtManagementGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIfAtManagementGroupScope( + "myManagementGruop", + "exampleDeploymentName", + new ScopedDeploymentWhatIf() + .withLocation("eastus") + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_WhatIfAtSubscriptionScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIfAtSubscriptionScope. */ +public final class DeploymentsWhatIfAtSubscriptionScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnSubscription.json + */ + /** + * Sample code: Predict template changes at subscription scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtSubscriptionScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIfAtSubscriptionScope( + "my-deployment", + new DeploymentWhatIf() + .withLocation("westus") + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_WhatIfAtTenantScope + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIfAtTenantScope. */ +public final class DeploymentsWhatIfAtTenantScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnTenant.json + */ + /** + * Sample code: Predict template changes at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtManagementGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIfAtTenantScope( + "exampleDeploymentName", + new ScopedDeploymentWhatIf() + .withLocation("eastus") + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} +``` + +### ProviderResourceTypes_List + +```java +/** Samples for ProviderResourceTypes List. */ +public final class ProviderResourceTypesListSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProviderResourceTypes.json + */ + /** + * Sample code: Get provider resource types. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviderResourceTypes(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providerResourceTypes().listWithResponse("Microsoft.TestRP", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Providers_Get + +```java +/** Samples for Providers Get. */ +public final class ProvidersGetSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProvider.json + */ + /** + * Sample code: Get provider. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProvider(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providers().getWithResponse("Microsoft.TestRP1", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Providers_GetAtTenantScope + +```java +/** Samples for Providers GetAtTenantScope. */ +public final class ProvidersGetAtTenantScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetNamedProviderAtTenant.json + */ + /** + * Sample code: Get a resource provider at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void getAResourceProviderAtTenantScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .providers() + .getAtTenantScopeWithResponse( + "Microsoft.Storage", "resourceTypes/aliases", com.azure.core.util.Context.NONE); + } +} +``` + +### Providers_List + +```java +/** Samples for Providers List. */ +public final class ProvidersListSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProviders.json + */ + /** + * Sample code: Get providers. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviders(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providers().list(null, com.azure.core.util.Context.NONE); + } +} +``` + +### Providers_ProviderPermissions + +```java +/** Samples for Providers ProviderPermissions. */ +public final class ProvidersProviderPermissionsSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProviderPermissions.json + */ + /** + * Sample code: Get provider resource types. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviderResourceTypes(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providers().providerPermissionsWithResponse("Microsoft.TestRP", com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceGroups_CreateOrUpdate + +```java +/** Samples for ResourceGroups CreateOrUpdate. */ +public final class ResourceGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/CreateResourceGroup.json + */ + /** + * Sample code: Create or update a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void createOrUpdateAResourceGroup( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.resourceGroups().define("my-resource-group").withRegion("eastus").create(); + } +} +``` + +### ResourceGroups_Delete + +```java +/** Samples for ResourceGroups Delete. */ +public final class ResourceGroupsDeleteSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ForceDeleteVMsInResourceGroup.json + */ + /** + * Sample code: Force delete all the Virtual Machines in a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void forceDeleteAllTheVirtualMachinesInAResourceGroup( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .delete("my-resource-group", "Microsoft.Compute/virtualMachines", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json + */ + /** + * Sample code: Force delete all the Virtual Machines and Virtual Machine Scale Sets in a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .delete( + "my-resource-group", + "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets", + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceGroups_ExportTemplate + +```java +import com.azure.resourcemanager.resources.generated.models.ExportTemplateRequest; +import java.util.Arrays; + +/** Samples for ResourceGroups ExportTemplate. */ +public final class ResourceGroupsExportTemplateSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ExportResourceGroup.json + */ + /** + * Sample code: Export a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroup(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .exportTemplate( + "my-resource-group", + new ExportTemplateRequest() + .withResources(Arrays.asList("*")) + .withOptions("IncludeParameterDefaultValue,IncludeComments"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ExportResourceGroupWithFiltering.json + */ + /** + * Sample code: Export a resource group with filtering. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroupWithFiltering( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .exportTemplate( + "my-resource-group", + new ExportTemplateRequest() + .withResources( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource")) + .withOptions("SkipResourceNameParameterization"), + com.azure.core.util.Context.NONE); + } +} +``` + +### TagOperations_CreateOrUpdateAtScope + +```java +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.generated.models.Tags; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TagOperations CreateOrUpdateAtScope. */ +public final class TagOperationsCreateOrUpdateAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .createOrUpdateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + new TagsResourceInner() + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .createOrUpdateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000", + new TagsResourceInner() + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### TagOperations_DeleteAtScope + +```java +/** Samples for TagOperations DeleteAtScope. */ +public final class TagOperationsDeleteAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/DeleteTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .deleteAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/DeleteTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .deleteAtScope("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + +### TagOperations_GetAtScope + +```java +/** Samples for TagOperations GetAtScope. */ +public final class TagOperationsGetAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetTagsResource.json + */ + /** + * Sample code: Get tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void getTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .getAtScopeWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetTagsSubscription.json + */ + /** + * Sample code: Get tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void getTagsOnASubscription(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .getAtScopeWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + +### TagOperations_UpdateAtScope + +```java +import com.azure.resourcemanager.resources.generated.models.Tags; +import com.azure.resourcemanager.resources.generated.models.TagsPatchOperation; +import com.azure.resourcemanager.resources.generated.models.TagsPatchResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TagOperations UpdateAtScope. */ +public final class TagOperationsUpdateAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PatchTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .updateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + new TagsPatchResource() + .withOperation(TagsPatchOperation.REPLACE) + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PatchTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .updateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000", + new TagsPatchResource() + .withOperation(TagsPatchOperation.REPLACE) + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/resources/azure-resourcemanager-resources-generated/pom.xml b/sdk/resources/azure-resourcemanager-resources-generated/pom.xml new file mode 100644 index 0000000000000..189365a95d5fc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-resources-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Resource Management + This package contains Microsoft Azure SDK for Resource Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Provides operations for working with resources and resource groups. Package tag package-resources-2022-09. + 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 + + + + com.azure + azure-core + 1.38.0 + + + com.azure + azure-core-management + 1.11.0 + + + diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/ResourceManager.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/ResourceManager.java new file mode 100644 index 0000000000000..d7b2ad9779e40 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/ResourceManager.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated; + +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.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.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resources.generated.fluent.ResourceManagementClient; +import com.azure.resourcemanager.resources.generated.implementation.DeploymentOperationsImpl; +import com.azure.resourcemanager.resources.generated.implementation.DeploymentsImpl; +import com.azure.resourcemanager.resources.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.resources.generated.implementation.ProviderResourceTypesImpl; +import com.azure.resourcemanager.resources.generated.implementation.ProvidersImpl; +import com.azure.resourcemanager.resources.generated.implementation.ResourceGroupsImpl; +import com.azure.resourcemanager.resources.generated.implementation.ResourceManagementClientBuilder; +import com.azure.resourcemanager.resources.generated.implementation.ResourcesImpl; +import com.azure.resourcemanager.resources.generated.implementation.TagOperationsImpl; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperations; +import com.azure.resourcemanager.resources.generated.models.Deployments; +import com.azure.resourcemanager.resources.generated.models.Operations; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceTypes; +import com.azure.resourcemanager.resources.generated.models.Providers; +import com.azure.resourcemanager.resources.generated.models.ResourceGroups; +import com.azure.resourcemanager.resources.generated.models.Resources; +import com.azure.resourcemanager.resources.generated.models.TagOperations; +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 ResourceManager. Provides operations for working with resources and resource groups. */ +public final class ResourceManager { + private Operations operations; + + private Deployments deployments; + + private Providers providers; + + private ProviderResourceTypes providerResourceTypes; + + private Resources resources; + + private ResourceGroups resourceGroups; + + private TagOperations tagOperations; + + private DeploymentOperations deploymentOperations; + + private final ResourceManagementClient clientObject; + + private ResourceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ResourceManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Resource service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Resource service API instance. + */ + public static ResourceManager 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 Resource service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Resource service API instance. + */ + public static ResourceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ResourceManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ResourceManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ResourceManager.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 Resource service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Resource service API instance. + */ + public ResourceManager 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.resources.generated") + .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 ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ResourceManager(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 Deployments. It manages DeploymentExtended. + * + * @return Resource collection API of Deployments. + */ + public Deployments deployments() { + if (this.deployments == null) { + this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this); + } + return deployments; + } + + /** + * Gets the resource collection API of Providers. + * + * @return Resource collection API of Providers. + */ + public Providers providers() { + if (this.providers == null) { + this.providers = new ProvidersImpl(clientObject.getProviders(), this); + } + return providers; + } + + /** + * Gets the resource collection API of ProviderResourceTypes. + * + * @return Resource collection API of ProviderResourceTypes. + */ + public ProviderResourceTypes providerResourceTypes() { + if (this.providerResourceTypes == null) { + this.providerResourceTypes = new ProviderResourceTypesImpl(clientObject.getProviderResourceTypes(), this); + } + return providerResourceTypes; + } + + /** + * Gets the resource collection API of Resources. + * + * @return Resource collection API of Resources. + */ + public Resources resources() { + if (this.resources == null) { + this.resources = new ResourcesImpl(clientObject.getResources(), this); + } + return resources; + } + + /** + * Gets the resource collection API of ResourceGroups. It manages ResourceGroup. + * + * @return Resource collection API of ResourceGroups. + */ + public ResourceGroups resourceGroups() { + if (this.resourceGroups == null) { + this.resourceGroups = new ResourceGroupsImpl(clientObject.getResourceGroups(), this); + } + return resourceGroups; + } + + /** + * Gets the resource collection API of TagOperations. + * + * @return Resource collection API of TagOperations. + */ + public TagOperations tagOperations() { + if (this.tagOperations == null) { + this.tagOperations = new TagOperationsImpl(clientObject.getTagOperations(), this); + } + return tagOperations; + } + + /** + * Gets the resource collection API of DeploymentOperations. + * + * @return Resource collection API of DeploymentOperations. + */ + public DeploymentOperations deploymentOperations() { + if (this.deploymentOperations == null) { + this.deploymentOperations = new DeploymentOperationsImpl(clientObject.getDeploymentOperations(), this); + } + return deploymentOperations; + } + + /** + * @return Wrapped service client ResourceManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public ResourceManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentOperationsClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentOperationsClient.java new file mode 100644 index 0000000000000..28e72e9376e81 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentOperationsClient.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner; + +/** An instance of this class provides access to all the operations defined in DeploymentOperationsClient. */ +public interface DeploymentOperationsClient { + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtScopeWithResponse( + String scope, String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentOperationInner getAtScope(String scope, String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtScope(String scope, String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtScope( + String scope, String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtTenantScopeWithResponse( + String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentOperationInner getAtTenantScope(String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentOperationInner getAtManagementGroupScope(String groupId, String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroupScope( + String groupId, String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtSubscriptionScopeWithResponse( + String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentOperationInner getAtSubscriptionScope(String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtSubscriptionScope(String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtSubscriptionScope( + String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentOperationInner get(String resourceGroupName, String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String deploymentName, Integer top, Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentsClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentsClient.java new file mode 100644 index 0000000000000..509adf039b107 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/DeploymentsClient.java @@ -0,0 +1,2064 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.models.DeploymentExportResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExtendedInner; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentValidateResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TemplateHashResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.WhatIfOperationResultInner; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; + +/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +public interface DeploymentsClient { + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtScope(String scope, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtScope(String scope, String deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceAtScope(String scope, String deploymentName); + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters); + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters, Context context); + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploymentName, Deployment parameters); + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtScopeWithResponse(String scope, String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner getAtScope(String scope, String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtScopeWithResponse(String scope, String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtScope(String scope, String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( + String scope, String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( + String scope, String deploymentName, Deployment parameters, Context context); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtScope( + String scope, String deploymentName, Deployment parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateAtScopeWithResponse( + String scope, String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName); + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtScope(String scope); + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtScope(String scope, String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtTenantScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtTenantScope(String deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtTenantScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtTenantScope(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceAtTenantScope(String deploymentName); + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters); + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters); + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner getAtTenantScope(String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtTenantScope(String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> beginValidateAtTenantScope( + String deploymentName, ScopedDeployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> beginValidateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtTenantScope(String deploymentName, ScopedDeployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateAtTenantScopeWithResponse( + String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExportResultInner exportTemplateAtTenantScope(String deploymentName); + + /** + * Get all the deployments at the tenant scope. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(); + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtManagementGroupScope( + String groupId, String deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtManagementGroupScope(String groupId, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters); + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters); + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtManagementGroupScopeWithResponse(String groupId, String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> + beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> + beginValidateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group 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 all the deployments for a management group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroupScope(String groupId); + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtManagementGroupScope( + String groupId, String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtSubscriptionScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtSubscriptionScope(String deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtSubscriptionScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtSubscriptionScope(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceAtSubscriptionScope(String deploymentName); + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtSubscriptionScope( + String deploymentName, Deployment parameters); + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context); + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters); + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtSubscriptionScopeWithResponse(String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner getAtSubscriptionScope(String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtSubscriptionScopeWithResponse(String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtSubscriptionScope(String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> + beginValidateAtSubscriptionScope(String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> + beginValidateAtSubscriptionScope(String deploymentName, Deployment parameters, Context context); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtSubscriptionScope(String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIfAtSubscriptionScope( + String deploymentName, DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIfAtSubscriptionScope( + String deploymentName, DeploymentWhatIf parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIfAtSubscriptionScope( + String deploymentName, DeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateAtSubscriptionScopeWithResponse( + String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName); + + /** + * Get all the deployments for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 deploymentName, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceWithResponse(String resourceGroupName, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistence(String resourceGroupName, String deploymentName); + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters); + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context); + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, Deployment parameters); + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner createOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelWithResponse(String resourceGroupName, String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> beginValidate( + String resourceGroupName, String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentValidateResultInner> beginValidate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validate(String resourceGroupName, String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentValidateResultInner validate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, WhatIfOperationResultInner> beginWhatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIf(String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WhatIfOperationResultInner whatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportTemplateWithResponse( + String resourceGroupName, String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentExportResultInner exportTemplate(String resourceGroupName, String deploymentName); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response calculateTemplateHashWithResponse(Object template, Context context); + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TemplateHashResultInner calculateTemplateHash(Object template); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/OperationsClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..b6e3e25ecb2b0 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProviderResourceTypesClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProviderResourceTypesClient.java new file mode 100644 index 0000000000000..4015671071553 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProviderResourceTypesClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderResourceTypeListResultInner; + +/** An instance of this class provides access to all the operations defined in ProviderResourceTypesClient. */ +public interface ProviderResourceTypesClient { + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceProviderNamespace, String expand, Context context); + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderResourceTypeListResultInner list(String resourceProviderNamespace); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProvidersClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProvidersClient.java new file mode 100644 index 0000000000000..862e75ac95393 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ProvidersClient.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderPermissionListResultInner; +import com.azure.resourcemanager.resources.generated.models.ProviderRegistrationRequest; + +/** An instance of this class provides access to all the operations defined in ProvidersClient. */ +public interface ProvidersClient { + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response unregisterWithResponse(String resourceProviderNamespace, Context context); + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInner unregister(String resourceProviderNamespace); + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response registerAtManagementGroupScopeWithResponse( + String resourceProviderNamespace, String groupId, Context context); + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void registerAtManagementGroupScope(String resourceProviderNamespace, String groupId); + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource 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 the provider permissions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response providerPermissionsWithResponse( + String resourceProviderNamespace, Context context); + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider permissions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderPermissionListResultInner providerPermissions(String resourceProviderNamespace); + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param properties The third party consent for S2S. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response registerWithResponse( + String resourceProviderNamespace, ProviderRegistrationRequest properties, Context context); + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInner register(String resourceProviderNamespace); + + /** + * Gets all resource providers for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String expand, Context context); + + /** + * Gets all resource providers for the tenant. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(); + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAtTenantScope(String expand, Context context); + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceProviderNamespace, String expand, Context context); + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInner get(String resourceProviderNamespace); + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtTenantScopeWithResponse( + String resourceProviderNamespace, String expand, Context context); + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProviderInner getAtTenantScope(String resourceProviderNamespace); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceGroupsClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceGroupsClient.java new file mode 100644 index 0000000000000..8244a5b55730f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceGroupsClient.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.models.ResourceGroupExportResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner; +import com.azure.resourcemanager.resources.generated.models.ExportTemplateRequest; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupPatchable; + +/** An instance of this class provides access to all the operations defined in ResourceGroupsClient. */ +public interface ResourceGroupsClient { + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceWithResponse(String resourceGroupName, Context context); + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistence(String resourceGroupName); + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, ResourceGroupInner parameters, Context context); + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 forceDeletionTypes, Context context); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 forceDeletionTypes, Context context); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, Context context); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupInner get(String resourceGroupName); + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, ResourceGroupPatchable parameters, Context context); + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters); + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource group export result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( + String resourceGroupName, ExportTemplateRequest parameters); + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource group export result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( + String resourceGroupName, ExportTemplateRequest parameters, Context context); + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters); + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceGroupExportResultInner exportTemplate( + String resourceGroupName, ExportTemplateRequest parameters, Context context); + + /** + * Gets all the resource groups for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceManagementClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceManagementClient.java new file mode 100644 index 0000000000000..69cdcea6288e1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourceManagementClient.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.resources.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ResourceManagementClient class. */ +public interface ResourceManagementClient { + /** + * Gets The Microsoft Azure subscription ID. + * + * @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 DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + DeploymentsClient getDeployments(); + + /** + * Gets the ProvidersClient object to access its operations. + * + * @return the ProvidersClient object. + */ + ProvidersClient getProviders(); + + /** + * Gets the ProviderResourceTypesClient object to access its operations. + * + * @return the ProviderResourceTypesClient object. + */ + ProviderResourceTypesClient getProviderResourceTypes(); + + /** + * Gets the ResourcesClient object to access its operations. + * + * @return the ResourcesClient object. + */ + ResourcesClient getResources(); + + /** + * Gets the ResourceGroupsClient object to access its operations. + * + * @return the ResourceGroupsClient object. + */ + ResourceGroupsClient getResourceGroups(); + + /** + * Gets the TagOperationsClient object to access its operations. + * + * @return the TagOperationsClient object. + */ + TagOperationsClient getTagOperations(); + + /** + * Gets the DeploymentOperationsClient object to access its operations. + * + * @return the DeploymentOperationsClient object. + */ + DeploymentOperationsClient getDeploymentOperations(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourcesClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourcesClient.java new file mode 100644 index 0000000000000..ee9bcc12d964f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/ResourcesClient.java @@ -0,0 +1,935 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.models.GenericResourceExpandedInner; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner; +import com.azure.resourcemanager.resources.generated.models.ResourcesMoveInfo; + +/** An instance of this class provides access to all the operations defined in ResourcesClient. */ +public interface ResourcesClient { + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String expand, Integer top, Context context); + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginValidateMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters); + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginValidateMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); + + /** + * Get all the resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, String expand, Integer top, Context context); + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistence( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters); + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context); + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters); + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context); + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters); + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context); + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters); + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context); + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner get( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context); + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkExistenceById(String resourceId, String apiVersion); + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteById(String resourceId, String apiVersion); + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteById(String resourceId, String apiVersion, Context context); + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteById(String resourceId, String apiVersion); + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteById(String resourceId, String apiVersion, Context context); + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginCreateOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters); + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginCreateOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context); + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters); + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner createOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context); + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters); + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GenericResourceInner> beginUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context); + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters); + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner updateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context); + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByIdWithResponse(String resourceId, String apiVersion, Context context); + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GenericResourceInner getById(String resourceId, String apiVersion); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/TagOperationsClient.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/TagOperationsClient.java new file mode 100644 index 0000000000000..a3634eae1b070 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/TagOperationsClient.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.models.TagDetailsInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.generated.models.TagsPatchResource; + +/** An instance of this class provides access to all the operations defined in TagOperationsClient. */ +public interface TagOperationsClient { + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 deleteValueWithResponse(String tagName, String tagValue, Context context); + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteValue(String tagName, String tagValue); + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context); + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagValueInner createOrUpdateValue(String tagName, String tagValue); + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String tagName, Context context); + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagDetailsInner createOrUpdate(String tagName); + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 tagName, Context context); + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 tagName); + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope( + String scope, TagsResourceInner parameters); + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope( + String scope, TagsResourceInner parameters, Context context); + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters); + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context); + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginUpdateAtScope( + String scope, TagsPatchResource parameters); + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TagsResourceInner> beginUpdateAtScope( + String scope, TagsPatchResource parameters, Context context); + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters); + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters, Context context); + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAtScopeWithResponse(String scope, Context context); + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TagsResourceInner getAtScope(String scope); + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtScope(String scope); + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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> beginDeleteAtScope(String scope, Context context); + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope); + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope, Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExportResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExportResultInner.java new file mode 100644 index 0000000000000..2cad9d6d4cd65 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExportResultInner.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.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The deployment export result. */ +@Fluent +public final class DeploymentExportResultInner { + /* + * The template content. + */ + @JsonProperty(value = "template") + private Object template; + + /** Creates an instance of DeploymentExportResultInner class. */ + public DeploymentExportResultInner() { + } + + /** + * Get the template property: The template content. + * + * @return the template value. + */ + public Object template() { + return this.template; + } + + /** + * Set the template property: The template content. + * + * @param template the template value to set. + * @return the DeploymentExportResultInner object itself. + */ + public DeploymentExportResultInner withTemplate(Object template) { + this.template = template; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExtendedInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExtendedInner.java new file mode 100644 index 0000000000000..d8a2291689b03 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentExtendedInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.resources.generated.models.DeploymentPropertiesExtended; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Deployment information. */ +@Fluent +public final class DeploymentExtendedInner extends Resource { + /* + * Deployment properties. + */ + @JsonProperty(value = "properties") + private DeploymentPropertiesExtended properties; + + /** Creates an instance of DeploymentExtendedInner class. */ + public DeploymentExtendedInner() { + } + + /** + * Get the properties property: Deployment properties. + * + * @return the properties value. + */ + public DeploymentPropertiesExtended properties() { + return this.properties; + } + + /** + * Set the properties property: Deployment properties. + * + * @param properties the properties value to set. + * @return the DeploymentExtendedInner object itself. + */ + public DeploymentExtendedInner withProperties(DeploymentPropertiesExtended properties) { + this.properties = properties; + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentExtendedInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentExtendedInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentOperationInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentOperationInner.java new file mode 100644 index 0000000000000..c722185a0b577 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentOperationInner.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment operation information. */ +@Fluent +public final class DeploymentOperationInner { + /* + * Full deployment operation ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * Deployment operation ID. + */ + @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) + private String operationId; + + /* + * Deployment properties. + */ + @JsonProperty(value = "properties") + private DeploymentOperationProperties properties; + + /** Creates an instance of DeploymentOperationInner class. */ + public DeploymentOperationInner() { + } + + /** + * Get the id property: Full deployment operation ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the operationId property: Deployment operation ID. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Get the properties property: Deployment properties. + * + * @return the properties value. + */ + public DeploymentOperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Deployment properties. + * + * @param properties the properties value to set. + * @return the DeploymentOperationInner object itself. + */ + public DeploymentOperationInner withProperties(DeploymentOperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentValidateResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentValidateResultInner.java new file mode 100644 index 0000000000000..134bac03e30fb --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/DeploymentValidateResultInner.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.models.DeploymentPropertiesExtended; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information from validate template deployment response. */ +@Fluent +public final class DeploymentValidateResultInner { + /* + * Error Response + * + * The deployment validation error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ManagementError error; + + /* + * The template deployment properties. + */ + @JsonProperty(value = "properties") + private DeploymentPropertiesExtended properties; + + /** Creates an instance of DeploymentValidateResultInner class. */ + public DeploymentValidateResultInner() { + } + + /** + * Get the error property: Error Response + * + *

The deployment validation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the properties property: The template deployment properties. + * + * @return the properties value. + */ + public DeploymentPropertiesExtended properties() { + return this.properties; + } + + /** + * Set the properties property: The template deployment properties. + * + * @param properties the properties value to set. + * @return the DeploymentValidateResultInner object itself. + */ + public DeploymentValidateResultInner withProperties(DeploymentPropertiesExtended properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceExpandedInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceExpandedInner.java new file mode 100644 index 0000000000000..27914b5816538 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceExpandedInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.ExtendedLocation; +import com.azure.resourcemanager.resources.generated.models.Identity; +import com.azure.resourcemanager.resources.generated.models.Plan; +import com.azure.resourcemanager.resources.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** Resource information. */ +@Fluent +public final class GenericResourceExpandedInner extends GenericResourceInner { + /* + * The created time of the resource. This is only present if requested via the $expand query parameter. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * The changed time of the resource. This is only present if requested via the $expand query parameter. + */ + @JsonProperty(value = "changedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime changedTime; + + /* + * The provisioning state of the resource. This is only present if requested via the $expand query parameter. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of GenericResourceExpandedInner class. */ + public GenericResourceExpandedInner() { + } + + /** + * Get the createdTime property: The created time of the resource. This is only present if requested via the $expand + * query parameter. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the changedTime property: The changed time of the resource. This is only present if requested via the $expand + * query parameter. + * + * @return the changedTime value. + */ + public OffsetDateTime changedTime() { + return this.changedTime; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. This is only present if requested via + * the $expand query parameter. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withPlan(Plan plan) { + super.withPlan(plan); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withProperties(Object properties) { + super.withProperties(properties); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withKind(String kind) { + super.withKind(kind); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withManagedBy(String managedBy) { + super.withManagedBy(managedBy); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withSku(Sku sku) { + super.withSku(sku); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withIdentity(Identity identity) { + super.withIdentity(identity); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withExtendedLocation(ExtendedLocation extendedLocation) { + super.withExtendedLocation(extendedLocation); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceExpandedInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceInner.java new file mode 100644 index 0000000000000..f448da08338e3 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/GenericResourceInner.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.resources.generated.models.ExtendedLocation; +import com.azure.resourcemanager.resources.generated.models.Identity; +import com.azure.resourcemanager.resources.generated.models.Plan; +import com.azure.resourcemanager.resources.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource information. */ +@Fluent +public class GenericResourceInner extends Resource { + /* + * The plan of the resource. + */ + @JsonProperty(value = "plan") + private Plan plan; + + /* + * The resource properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * The kind of the resource. + */ + @JsonProperty(value = "kind") + private String kind; + + /* + * ID of the resource that manages this resource. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /* + * The SKU of the resource. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /* + * Resource extended location. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + + /** Creates an instance of GenericResourceInner class. */ + public GenericResourceInner() { + } + + /** + * Get the plan property: The plan of the resource. + * + * @return the plan value. + */ + public Plan plan() { + return this.plan; + } + + /** + * Set the plan property: The plan of the resource. + * + * @param plan the plan value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withPlan(Plan plan) { + this.plan = plan; + return this; + } + + /** + * Get the properties property: The resource properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: The resource properties. + * + * @param properties the properties value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the kind property: The kind of the resource. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the resource. + * + * @param kind the kind value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the managedBy property: ID of the resource that manages this resource. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: ID of the resource that manages this resource. + * + * @param managedBy the managedBy value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get the sku property: The SKU of the resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The SKU of the resource. + * + * @param sku the sku value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the extendedLocation property: Resource extended location. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: Resource extended location. + * + * @param extendedLocation the extendedLocation value to set. + * @return the GenericResourceInner object itself. + */ + public GenericResourceInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public GenericResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (plan() != null) { + plan().validate(); + } + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/OperationInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..8279a4fe9e861 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/OperationInner.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Microsoft.Resources operation. */ +@Fluent +public final class OperationInner { + /* + * Operation name: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderInner.java new file mode 100644 index 0000000000000..9c0c000c9c202 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderInner.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.ProviderAuthorizationConsentState; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Resource provider information. */ +@Fluent +public final class ProviderInner { + /* + * The provider ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The namespace of the resource provider. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /* + * The registration state of the resource provider. + */ + @JsonProperty(value = "registrationState", access = JsonProperty.Access.WRITE_ONLY) + private String registrationState; + + /* + * The registration policy of the resource provider. + */ + @JsonProperty(value = "registrationPolicy", access = JsonProperty.Access.WRITE_ONLY) + private String registrationPolicy; + + /* + * The collection of provider resource types. + */ + @JsonProperty(value = "resourceTypes", access = JsonProperty.Access.WRITE_ONLY) + private List resourceTypes; + + /* + * The provider authorization consent state. + */ + @JsonProperty(value = "providerAuthorizationConsentState") + private ProviderAuthorizationConsentState providerAuthorizationConsentState; + + /** Creates an instance of ProviderInner class. */ + public ProviderInner() { + } + + /** + * Get the id property: The provider ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the namespace property: The namespace of the resource provider. + * + * @return the namespace value. + */ + public String namespace() { + return this.namespace; + } + + /** + * Set the namespace property: The namespace of the resource provider. + * + * @param namespace the namespace value to set. + * @return the ProviderInner object itself. + */ + public ProviderInner withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get the registrationState property: The registration state of the resource provider. + * + * @return the registrationState value. + */ + public String registrationState() { + return this.registrationState; + } + + /** + * Get the registrationPolicy property: The registration policy of the resource provider. + * + * @return the registrationPolicy value. + */ + public String registrationPolicy() { + return this.registrationPolicy; + } + + /** + * Get the resourceTypes property: The collection of provider resource types. + * + * @return the resourceTypes value. + */ + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Get the providerAuthorizationConsentState property: The provider authorization consent state. + * + * @return the providerAuthorizationConsentState value. + */ + public ProviderAuthorizationConsentState providerAuthorizationConsentState() { + return this.providerAuthorizationConsentState; + } + + /** + * Set the providerAuthorizationConsentState property: The provider authorization consent state. + * + * @param providerAuthorizationConsentState the providerAuthorizationConsentState value to set. + * @return the ProviderInner object itself. + */ + public ProviderInner withProviderAuthorizationConsentState( + ProviderAuthorizationConsentState providerAuthorizationConsentState) { + this.providerAuthorizationConsentState = providerAuthorizationConsentState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceTypes() != null) { + resourceTypes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderPermissionListResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderPermissionListResultInner.java new file mode 100644 index 0000000000000..777f163b5ee19 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderPermissionListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.ProviderPermission; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of provider permissions. */ +@Fluent +public final class ProviderPermissionListResultInner { + /* + * An array of provider permissions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ProviderPermissionListResultInner class. */ + public ProviderPermissionListResultInner() { + } + + /** + * Get the value property: An array of provider permissions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of provider permissions. + * + * @param value the value value to set. + * @return the ProviderPermissionListResultInner object itself. + */ + public ProviderPermissionListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderResourceTypeListResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderResourceTypeListResultInner.java new file mode 100644 index 0000000000000..b2719c1f6222e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ProviderResourceTypeListResultInner.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of resource types of a resource provider. */ +@Fluent +public final class ProviderResourceTypeListResultInner { + /* + * An array of resource types. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ProviderResourceTypeListResultInner class. */ + public ProviderResourceTypeListResultInner() { + } + + /** + * Get the value property: An array of resource types. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of resource types. + * + * @param value the value value to set. + * @return the ProviderResourceTypeListResultInner object itself. + */ + public ProviderResourceTypeListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupExportResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupExportResultInner.java new file mode 100644 index 0000000000000..2aa04ca693185 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupExportResultInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource group export result. */ +@Fluent +public final class ResourceGroupExportResultInner { + /* + * The template content. + */ + @JsonProperty(value = "template") + private Object template; + + /* + * Error Response + * + * The template export error. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of ResourceGroupExportResultInner class. */ + public ResourceGroupExportResultInner() { + } + + /** + * Get the template property: The template content. + * + * @return the template value. + */ + public Object template() { + return this.template; + } + + /** + * Set the template property: The template content. + * + * @param template the template value to set. + * @return the ResourceGroupExportResultInner object itself. + */ + public ResourceGroupExportResultInner withTemplate(Object template) { + this.template = template; + return this; + } + + /** + * Get the error property: Error Response + * + *

The template export error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: Error Response + * + *

The template export error. + * + * @param error the error value to set. + * @return the ResourceGroupExportResultInner object itself. + */ + public ResourceGroupExportResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupInner.java new file mode 100644 index 0000000000000..e84147a830bd3 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/ResourceGroupInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource group information. */ +@Fluent +public final class ResourceGroupInner extends Resource { + /* + * The resource group properties. + */ + @JsonProperty(value = "properties") + private ResourceGroupProperties properties; + + /* + * The ID of the resource that manages this resource group. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /** Creates an instance of ResourceGroupInner class. */ + public ResourceGroupInner() { + } + + /** + * Get the properties property: The resource group properties. + * + * @return the properties value. + */ + public ResourceGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource group properties. + * + * @param properties the properties value to set. + * @return the ResourceGroupInner object itself. + */ + public ResourceGroupInner withProperties(ResourceGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the managedBy property: The ID of the resource that manages this resource group. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: The ID of the resource that manages this resource group. + * + * @param managedBy the managedBy value to set. + * @return the ResourceGroupInner object itself. + */ + public ResourceGroupInner withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ResourceGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagDetailsInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagDetailsInner.java new file mode 100644 index 0000000000000..9eb8b54c9328e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagDetailsInner.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.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.TagCount; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Tag details. */ +@Fluent +public final class TagDetailsInner { + /* + * The tag name ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The tag name. + */ + @JsonProperty(value = "tagName") + private String tagName; + + /* + * The total number of resources that use the resource tag. When a tag is initially created and has no associated + * resources, the value is 0. + */ + @JsonProperty(value = "count") + private TagCount count; + + /* + * The list of tag values. + */ + @JsonProperty(value = "values") + private List values; + + /** Creates an instance of TagDetailsInner class. */ + public TagDetailsInner() { + } + + /** + * Get the id property: The tag name ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the tagName property: The tag name. + * + * @return the tagName value. + */ + public String tagName() { + return this.tagName; + } + + /** + * Set the tagName property: The tag name. + * + * @param tagName the tagName value to set. + * @return the TagDetailsInner object itself. + */ + public TagDetailsInner withTagName(String tagName) { + this.tagName = tagName; + return this; + } + + /** + * Get the count property: The total number of resources that use the resource tag. When a tag is initially created + * and has no associated resources, the value is 0. + * + * @return the count value. + */ + public TagCount count() { + return this.count; + } + + /** + * Set the count property: The total number of resources that use the resource tag. When a tag is initially created + * and has no associated resources, the value is 0. + * + * @param count the count value to set. + * @return the TagDetailsInner object itself. + */ + public TagDetailsInner withCount(TagCount count) { + this.count = count; + return this; + } + + /** + * Get the values property: The list of tag values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The list of tag values. + * + * @param values the values value to set. + * @return the TagDetailsInner object itself. + */ + public TagDetailsInner withValues(List values) { + this.values = values; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (count() != null) { + count().validate(); + } + if (values() != null) { + values().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagValueInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagValueInner.java new file mode 100644 index 0000000000000..7fb4b1a23fc1e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagValueInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.TagCount; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tag information. */ +@Fluent +public final class TagValueInner { + /* + * The tag value ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The tag value. + */ + @JsonProperty(value = "tagValue") + private String tagValue; + + /* + * The tag value count. + */ + @JsonProperty(value = "count") + private TagCount count; + + /** Creates an instance of TagValueInner class. */ + public TagValueInner() { + } + + /** + * Get the id property: The tag value ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the tagValue property: The tag value. + * + * @return the tagValue value. + */ + public String tagValue() { + return this.tagValue; + } + + /** + * Set the tagValue property: The tag value. + * + * @param tagValue the tagValue value to set. + * @return the TagValueInner object itself. + */ + public TagValueInner withTagValue(String tagValue) { + this.tagValue = tagValue; + return this; + } + + /** + * Get the count property: The tag value count. + * + * @return the count value. + */ + public TagCount count() { + return this.count; + } + + /** + * Set the count property: The tag value count. + * + * @param count the count value to set. + * @return the TagValueInner object itself. + */ + public TagValueInner withCount(TagCount count) { + this.count = count; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (count() != null) { + count().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagsResourceInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagsResourceInner.java new file mode 100644 index 0000000000000..9eb85faa64d6a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TagsResourceInner.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.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resources.generated.models.Tags; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Wrapper resource for tags API requests and responses. */ +@Fluent +public final class TagsResourceInner extends ProxyResource { + /* + * The set of tags. + */ + @JsonProperty(value = "properties", required = true) + private Tags properties; + + /** Creates an instance of TagsResourceInner class. */ + public TagsResourceInner() { + } + + /** + * Get the properties property: The set of tags. + * + * @return the properties value. + */ + public Tags properties() { + return this.properties; + } + + /** + * Set the properties property: The set of tags. + * + * @param properties the properties value to set. + * @return the TagsResourceInner object itself. + */ + public TagsResourceInner withProperties(Tags properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model TagsResourceInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TagsResourceInner.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TemplateHashResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TemplateHashResultInner.java new file mode 100644 index 0000000000000..f8de7cdf5d126 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/TemplateHashResultInner.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.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Result of the request to calculate template hash. It contains a string of minified template and its hash. */ +@Fluent +public final class TemplateHashResultInner { + /* + * The minified template string. + */ + @JsonProperty(value = "minifiedTemplate") + private String minifiedTemplate; + + /* + * The template hash. + */ + @JsonProperty(value = "templateHash") + private String templateHash; + + /** Creates an instance of TemplateHashResultInner class. */ + public TemplateHashResultInner() { + } + + /** + * Get the minifiedTemplate property: The minified template string. + * + * @return the minifiedTemplate value. + */ + public String minifiedTemplate() { + return this.minifiedTemplate; + } + + /** + * Set the minifiedTemplate property: The minified template string. + * + * @param minifiedTemplate the minifiedTemplate value to set. + * @return the TemplateHashResultInner object itself. + */ + public TemplateHashResultInner withMinifiedTemplate(String minifiedTemplate) { + this.minifiedTemplate = minifiedTemplate; + return this; + } + + /** + * Get the templateHash property: The template hash. + * + * @return the templateHash value. + */ + public String templateHash() { + return this.templateHash; + } + + /** + * Set the templateHash property: The template hash. + * + * @param templateHash the templateHash value to set. + * @return the TemplateHashResultInner object itself. + */ + public TemplateHashResultInner withTemplateHash(String templateHash) { + this.templateHash = templateHash; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationProperties.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationProperties.java new file mode 100644 index 0000000000000..5328a41fb3193 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.models.WhatIfChange; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Deployment operation properties. */ +@Fluent +public final class WhatIfOperationProperties { + /* + * List of resource changes predicted by What-If operation. + */ + @JsonProperty(value = "changes") + private List changes; + + /** Creates an instance of WhatIfOperationProperties class. */ + public WhatIfOperationProperties() { + } + + /** + * Get the changes property: List of resource changes predicted by What-If operation. + * + * @return the changes value. + */ + public List changes() { + return this.changes; + } + + /** + * Set the changes property: List of resource changes predicted by What-If operation. + * + * @param changes the changes value to set. + * @return the WhatIfOperationProperties object itself. + */ + public WhatIfOperationProperties withChanges(List changes) { + this.changes = changes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (changes() != null) { + changes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationResultInner.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationResultInner.java new file mode 100644 index 0000000000000..b549722bf95af --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/WhatIfOperationResultInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.models.WhatIfChange; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the What-If operation. Contains a list of predicted changes and a URL link to get to the next set of + * results. + */ +@Fluent +public final class WhatIfOperationResultInner { + /* + * Status of the What-If operation. + */ + @JsonProperty(value = "status") + private String status; + + /* + * What-If operation properties. + */ + @JsonProperty(value = "properties") + private WhatIfOperationProperties innerProperties; + + /* + * Error Response + * + * Error when What-If operation fails. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of WhatIfOperationResultInner class. */ + public WhatIfOperationResultInner() { + } + + /** + * Get the status property: Status of the What-If operation. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the What-If operation. + * + * @param status the status value to set. + * @return the WhatIfOperationResultInner object itself. + */ + public WhatIfOperationResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the innerProperties property: What-If operation properties. + * + * @return the innerProperties value. + */ + private WhatIfOperationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the error property: Error Response + * + *

Error when What-If operation fails. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: Error Response + * + *

Error when What-If operation fails. + * + * @param error the error value to set. + * @return the WhatIfOperationResultInner object itself. + */ + public WhatIfOperationResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Get the changes property: List of resource changes predicted by What-If operation. + * + * @return the changes value. + */ + public List changes() { + return this.innerProperties() == null ? null : this.innerProperties().changes(); + } + + /** + * Set the changes property: List of resource changes predicted by What-If operation. + * + * @param changes the changes value to set. + * @return the WhatIfOperationResultInner object itself. + */ + public WhatIfOperationResultInner withChanges(List changes) { + if (this.innerProperties() == null) { + this.innerProperties = new WhatIfOperationProperties(); + } + this.innerProperties().withChanges(changes); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/package-info.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..cf72c3ef077ed --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/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 ResourceManagementClient. Provides operations for working with resources + * and resource groups. + */ +package com.azure.resourcemanager.resources.generated.fluent.models; diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/package-info.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/fluent/package-info.java new file mode 100644 index 0000000000000..1d259c694411d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/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 ResourceManagementClient. Provides operations for working with resources + * and resource groups. + */ +package com.azure.resourcemanager.resources.generated.fluent; diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExportResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExportResultImpl.java new file mode 100644 index 0000000000000..a38b34c45ae86 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExportResultImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExportResultInner; +import com.azure.resourcemanager.resources.generated.models.DeploymentExportResult; + +public final class DeploymentExportResultImpl implements DeploymentExportResult { + private DeploymentExportResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + DeploymentExportResultImpl( + DeploymentExportResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Object template() { + return this.innerModel().template(); + } + + public DeploymentExportResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExtendedImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExtendedImpl.java new file mode 100644 index 0000000000000..c0a8c7aceac08 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentExtendedImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExtendedInner; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentExportResult; +import com.azure.resourcemanager.resources.generated.models.DeploymentExtended; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.DeploymentPropertiesExtended; +import com.azure.resourcemanager.resources.generated.models.DeploymentValidateResult; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.WhatIfOperationResult; +import java.util.Collections; +import java.util.Map; + +public final class DeploymentExtendedImpl + implements DeploymentExtended, DeploymentExtended.Definition, DeploymentExtended.Update { + private DeploymentExtendedInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager 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 DeploymentPropertiesExtended properties() { + return this.innerModel().properties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DeploymentExtendedInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deploymentName; + + private Deployment createParameters; + + private Deployment updateParameters; + + public DeploymentExtendedImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public DeploymentExtended create() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .createOrUpdate(resourceGroupName, deploymentName, createParameters, Context.NONE); + return this; + } + + public DeploymentExtended create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .createOrUpdate(resourceGroupName, deploymentName, createParameters, context); + return this; + } + + DeploymentExtendedImpl(String name, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = new DeploymentExtendedInner(); + this.serviceManager = serviceManager; + this.deploymentName = name; + this.createParameters = new Deployment(); + } + + public DeploymentExtendedImpl update() { + this.updateParameters = new Deployment(); + return this; + } + + public DeploymentExtended apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .createOrUpdate(resourceGroupName, deploymentName, updateParameters, Context.NONE); + return this; + } + + public DeploymentExtended apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .createOrUpdate(resourceGroupName, deploymentName, updateParameters, context); + return this; + } + + DeploymentExtendedImpl( + DeploymentExtendedInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "deployments"); + } + + public DeploymentExtended refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE) + .getValue(); + return this; + } + + public DeploymentExtended refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .getByResourceGroupWithResponse(resourceGroupName, deploymentName, context) + .getValue(); + return this; + } + + public Response cancelWithResponse(Context context) { + return serviceManager.deployments().cancelWithResponse(resourceGroupName, deploymentName, context); + } + + public void cancel() { + serviceManager.deployments().cancel(resourceGroupName, deploymentName); + } + + public DeploymentValidateResult validate(Deployment parameters) { + return serviceManager.deployments().validate(resourceGroupName, deploymentName, parameters); + } + + public DeploymentValidateResult validate(Deployment parameters, Context context) { + return serviceManager.deployments().validate(resourceGroupName, deploymentName, parameters, context); + } + + public WhatIfOperationResult whatIf(DeploymentWhatIf parameters) { + return serviceManager.deployments().whatIf(resourceGroupName, deploymentName, parameters); + } + + public WhatIfOperationResult whatIf(DeploymentWhatIf parameters, Context context) { + return serviceManager.deployments().whatIf(resourceGroupName, deploymentName, parameters, context); + } + + public Response exportTemplateWithResponse(Context context) { + return serviceManager.deployments().exportTemplateWithResponse(resourceGroupName, deploymentName, context); + } + + public DeploymentExportResult exportTemplate() { + return serviceManager.deployments().exportTemplate(resourceGroupName, deploymentName); + } + + public DeploymentExtendedImpl withProperties(DeploymentProperties properties) { + if (isInCreateMode()) { + this.createParameters.withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } + } + + public DeploymentExtendedImpl withRegion(Region location) { + this.createParameters.withLocation(location.toString()); + return this; + } + + public DeploymentExtendedImpl withRegion(String location) { + this.createParameters.withLocation(location); + return this; + } + + public DeploymentExtendedImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameters.withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationImpl.java new file mode 100644 index 0000000000000..be148521a7951 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperation; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperationProperties; + +public final class DeploymentOperationImpl implements DeploymentOperation { + private DeploymentOperationInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + DeploymentOperationImpl( + DeploymentOperationInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String operationId() { + return this.innerModel().operationId(); + } + + public DeploymentOperationProperties properties() { + return this.innerModel().properties(); + } + + public DeploymentOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsClientImpl.java new file mode 100644 index 0000000000000..54ea1bc203bdc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsClientImpl.java @@ -0,0 +1,2261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.DeploymentOperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperationsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeploymentOperationsClient. */ +public final class DeploymentOperationsClientImpl implements DeploymentOperationsClient { + /** The proxy service used to perform REST calls. */ + private final DeploymentOperationsService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of DeploymentOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeploymentOperationsClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy + .create(DeploymentOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientDeploymentOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface DeploymentOperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Resources/deployments/{deploymentName}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("$top") Integer top, + @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}/deployments/{deploymentName}/operations/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("operationId") String operationId, + @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}/deployments/{deploymentName}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtScopeNext( + @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> listAtTenantScopeNext( + @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> listAtManagementGroupScopeNext( + @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> listAtSubscriptionScopeNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtScopeWithResponseAsync( + String scope, String deploymentName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtScopeWithResponseAsync( + String scope, String deploymentName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtScopeAsync(String scope, String deploymentName, String operationId) { + return getAtScopeWithResponseAsync(scope, deploymentName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtScopeWithResponse( + String scope, String deploymentName, String operationId, Context context) { + return getAtScopeWithResponseAsync(scope, deploymentName, operationId, context).block(); + } + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentOperationInner getAtScope(String scope, String deploymentName, String operationId) { + return getAtScopeWithResponse(scope, deploymentName, operationId, Context.NONE).getValue(); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeSinglePageAsync( + String scope, String deploymentName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + top, + 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())); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeSinglePageAsync( + String scope, String deploymentName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtScope( + this.client.getEndpoint(), scope, deploymentName, top, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync(String scope, String deploymentName, Integer top) { + return new PagedFlux<>( + () -> listAtScopeSinglePageAsync(scope, deploymentName, top), + nextLink -> listAtScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync(String scope, String deploymentName) { + final Integer top = null; + return new PagedFlux<>( + () -> listAtScopeSinglePageAsync(scope, deploymentName, top), + nextLink -> listAtScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync( + String scope, String deploymentName, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtScopeSinglePageAsync(scope, deploymentName, top, context), + nextLink -> listAtScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtScope(String scope, String deploymentName) { + final Integer top = null; + return new PagedIterable<>(listAtScopeAsync(scope, deploymentName, top)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtScope( + String scope, String deploymentName, Integer top, Context context) { + return new PagedIterable<>(listAtScopeAsync(scope, deploymentName, top, context)); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtTenantScopeWithResponseAsync( + String deploymentName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtTenantScope( + this.client.getEndpoint(), + deploymentName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtTenantScopeWithResponseAsync( + String deploymentName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtTenantScope( + this.client.getEndpoint(), deploymentName, operationId, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtTenantScopeAsync(String deploymentName, String operationId) { + return getAtTenantScopeWithResponseAsync(deploymentName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtTenantScopeWithResponse( + String deploymentName, String operationId, Context context) { + return getAtTenantScopeWithResponseAsync(deploymentName, operationId, context).block(); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentOperationInner getAtTenantScope(String deploymentName, String operationId) { + return getAtTenantScopeWithResponse(deploymentName, operationId, Context.NONE).getValue(); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync( + String deploymentName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAtTenantScope( + this.client.getEndpoint(), + deploymentName, + top, + 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())); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync( + String deploymentName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtTenantScope( + this.client.getEndpoint(), deploymentName, top, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String deploymentName, Integer top) { + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(deploymentName, top), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String deploymentName) { + final Integer top = null; + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(deploymentName, top), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync( + String deploymentName, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(deploymentName, top, context), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope(String deploymentName) { + final Integer top = null; + return new PagedIterable<>(listAtTenantScopeAsync(deploymentName, top)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope( + String deploymentName, Integer top, Context context) { + return new PagedIterable<>(listAtTenantScopeAsync(deploymentName, top, context)); + } + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + operationId, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + operationId, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtManagementGroupScopeAsync( + String groupId, String deploymentName, String operationId) { + return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, String operationId, Context context) { + return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, operationId, context).block(); + } + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentOperationInner getAtManagementGroupScope( + String groupId, String deploymentName, String operationId) { + return getAtManagementGroupScopeWithResponse(groupId, deploymentName, operationId, Context.NONE).getValue(); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeSinglePageAsync( + String groupId, String deploymentName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + top, + 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())); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeSinglePageAsync( + String groupId, String deploymentName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtManagementGroupScope( + this.client.getEndpoint(), groupId, deploymentName, top, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync( + String groupId, String deploymentName, Integer top) { + return new PagedFlux<>( + () -> listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync(String groupId, String deploymentName) { + final Integer top = null; + return new PagedFlux<>( + () -> listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync( + String groupId, String deploymentName, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtManagementGroupScopeSinglePageAsync(groupId, deploymentName, top, context), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroupScope(String groupId, String deploymentName) { + final Integer top = null; + return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, deploymentName, top)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroupScope( + String groupId, String deploymentName, Integer top, Context context) { + return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, deploymentName, top, context)); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtSubscriptionScopeWithResponseAsync( + String deploymentName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required 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 + .getAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtSubscriptionScopeWithResponseAsync( + String deploymentName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required 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 + .getAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtSubscriptionScopeAsync(String deploymentName, String operationId) { + return getAtSubscriptionScopeWithResponseAsync(deploymentName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtSubscriptionScopeWithResponse( + String deploymentName, String operationId, Context context) { + return getAtSubscriptionScopeWithResponseAsync(deploymentName, operationId, context).block(); + } + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentOperationInner getAtSubscriptionScope(String deploymentName, String operationId) { + return getAtSubscriptionScopeWithResponse(deploymentName, operationId, Context.NONE).getValue(); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeSinglePageAsync( + String deploymentName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .listAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + top, + 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())); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeSinglePageAsync( + String deploymentName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .listAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + top, + 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)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtSubscriptionScopeAsync(String deploymentName, Integer top) { + return new PagedFlux<>( + () -> listAtSubscriptionScopeSinglePageAsync(deploymentName, top), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtSubscriptionScopeAsync(String deploymentName) { + final Integer top = null; + return new PagedFlux<>( + () -> listAtSubscriptionScopeSinglePageAsync(deploymentName, top), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtSubscriptionScopeAsync( + String deploymentName, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtSubscriptionScopeSinglePageAsync(deploymentName, top, context), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtSubscriptionScope(String deploymentName) { + final Integer top = null; + return new PagedIterable<>(listAtSubscriptionScopeAsync(deploymentName, top)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtSubscriptionScope( + String deploymentName, Integer top, Context context) { + return new PagedIterable<>(listAtSubscriptionScopeAsync(deploymentName, top, context)); + } + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String deploymentName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String deploymentName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + operationId, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String deploymentName, String operationId) { + return getWithResponseAsync(resourceGroupName, deploymentName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String deploymentName, String operationId, Context context) { + return getWithResponseAsync(resourceGroupName, deploymentName, operationId, context).block(); + } + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployments operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentOperationInner get(String resourceGroupName, String deploymentName, String operationId) { + return getWithResponse(resourceGroupName, deploymentName, operationId, Context.NONE).getValue(); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String deploymentName, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + top, + 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())); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String deploymentName, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + top, + 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)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String deploymentName, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, deploymentName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String deploymentName) { + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, deploymentName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String deploymentName, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, deploymentName, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String deploymentName) { + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, deploymentName, top)); + } + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String deploymentName, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, deploymentName, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeNextSinglePageAsync(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.listAtScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeNextSinglePageAsync( + 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 + .listAtScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeNextSinglePageAsync(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.listAtTenantScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeNextSinglePageAsync( + 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 + .listAtTenantScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeNextSinglePageAsync( + 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.listAtManagementGroupScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeNextSinglePageAsync( + 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 + .listAtManagementGroupScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeNextSinglePageAsync(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.listAtSubscriptionScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeNextSinglePageAsync( + 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 + .listAtSubscriptionScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployment operations 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsImpl.java new file mode 100644 index 0000000000000..79f0cf36bb1f0 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentOperationsImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.DeploymentOperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperation; +import com.azure.resourcemanager.resources.generated.models.DeploymentOperations; + +public final class DeploymentOperationsImpl implements DeploymentOperations { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentOperationsImpl.class); + + private final DeploymentOperationsClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public DeploymentOperationsImpl( + DeploymentOperationsClient innerClient, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getAtScopeWithResponse( + String scope, String deploymentName, String operationId, Context context) { + Response inner = + this.serviceClient().getAtScopeWithResponse(scope, deploymentName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentOperation getAtScope(String scope, String deploymentName, String operationId) { + DeploymentOperationInner inner = this.serviceClient().getAtScope(scope, deploymentName, operationId); + if (inner != null) { + return new DeploymentOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtScope(String scope, String deploymentName) { + PagedIterable inner = this.serviceClient().listAtScope(scope, deploymentName); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public PagedIterable listAtScope( + String scope, String deploymentName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listAtScope(scope, deploymentName, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public Response getAtTenantScopeWithResponse( + String deploymentName, String operationId, Context context) { + Response inner = + this.serviceClient().getAtTenantScopeWithResponse(deploymentName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentOperation getAtTenantScope(String deploymentName, String operationId) { + DeploymentOperationInner inner = this.serviceClient().getAtTenantScope(deploymentName, operationId); + if (inner != null) { + return new DeploymentOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtTenantScope(String deploymentName) { + PagedIterable inner = this.serviceClient().listAtTenantScope(deploymentName); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public PagedIterable listAtTenantScope(String deploymentName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listAtTenantScope(deploymentName, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, String operationId, Context context) { + Response inner = + this.serviceClient().getAtManagementGroupScopeWithResponse(groupId, deploymentName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentOperation getAtManagementGroupScope(String groupId, String deploymentName, String operationId) { + DeploymentOperationInner inner = + this.serviceClient().getAtManagementGroupScope(groupId, deploymentName, operationId); + if (inner != null) { + return new DeploymentOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtManagementGroupScope(String groupId, String deploymentName) { + PagedIterable inner = + this.serviceClient().listAtManagementGroupScope(groupId, deploymentName); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public PagedIterable listAtManagementGroupScope( + String groupId, String deploymentName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listAtManagementGroupScope(groupId, deploymentName, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public Response getAtSubscriptionScopeWithResponse( + String deploymentName, String operationId, Context context) { + Response inner = + this.serviceClient().getAtSubscriptionScopeWithResponse(deploymentName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentOperation getAtSubscriptionScope(String deploymentName, String operationId) { + DeploymentOperationInner inner = this.serviceClient().getAtSubscriptionScope(deploymentName, operationId); + if (inner != null) { + return new DeploymentOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtSubscriptionScope(String deploymentName) { + PagedIterable inner = this.serviceClient().listAtSubscriptionScope(deploymentName); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public PagedIterable listAtSubscriptionScope( + String deploymentName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listAtSubscriptionScope(deploymentName, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String deploymentName, String operationId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, deploymentName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentOperationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentOperation get(String resourceGroupName, String deploymentName, String operationId) { + DeploymentOperationInner inner = this.serviceClient().get(resourceGroupName, deploymentName, operationId); + if (inner != null) { + return new DeploymentOperationImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String deploymentName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, deploymentName); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String deploymentName, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, deploymentName, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentOperationImpl(inner1, this.manager())); + } + + private DeploymentOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentValidateResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentValidateResultImpl.java new file mode 100644 index 0000000000000..ebc7203fa569a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentValidateResultImpl.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentValidateResultInner; +import com.azure.resourcemanager.resources.generated.models.DeploymentPropertiesExtended; +import com.azure.resourcemanager.resources.generated.models.DeploymentValidateResult; + +public final class DeploymentValidateResultImpl implements DeploymentValidateResult { + private DeploymentValidateResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + DeploymentValidateResultImpl( + DeploymentValidateResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public DeploymentPropertiesExtended properties() { + return this.innerModel().properties(); + } + + public DeploymentValidateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsClientImpl.java new file mode 100644 index 0000000000000..c285b8ef430a7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsClientImpl.java @@ -0,0 +1,9772 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.Head; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.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.resources.generated.fluent.DeploymentsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExportResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExtendedInner; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentValidateResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TemplateHashResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.WhatIfOperationResultInner; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentListResult; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; +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 DeploymentsClient. */ +public final class DeploymentsClientImpl implements DeploymentsClient { + /** The proxy service used to perform REST calls. */ + private final DeploymentsService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of DeploymentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeploymentsClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientDeployments to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface DeploymentsService { + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistenceAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Deployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancelAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") + @ExpectedResponses({200, 202, 400}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Deployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> exportTemplateAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Resources/deployments/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head("/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistenceAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopedDeployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancelAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/validate") + @ExpectedResponses({200, 202, 400}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopedDeployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> whatIfAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopedDeploymentWhatIf parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> exportTemplateAtTenantScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Resources/deployments/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtTenantScope( + @HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistenceAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopedDeployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancelAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") + @ExpectedResponses({200, 202, 400}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopedDeployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> whatIfAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ScopedDeploymentWhatIf parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> exportTemplateAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("groupId") String groupId, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistenceAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") Deployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancelAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") + @ExpectedResponses({200, 202, 400}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") Deployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> whatIfAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DeploymentWhatIf parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> exportTemplateAtSubscriptionScope( + @HostParam("$host") String endpoint, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistence( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") Deployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate") + @ExpectedResponses({200, 202, 400}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") Deployment parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> whatIf( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DeploymentWhatIf parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> exportTemplate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @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.Resources/deployments/") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/providers/Microsoft.Resources/calculateTemplateHash") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> calculateTemplateHash( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") Object template, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtScopeNext( + @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> listAtTenantScopeNext( + @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> listAtManagementGroupScopeNext( + @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> listAtSubscriptionScopeNext( + @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); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtScopeWithResponseAsync(String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtScopeWithResponseAsync( + String scope, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAtScope( + this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtScopeAsync(String scope, String deploymentName) { + Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtScopeAsync( + String scope, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtScope(String scope, String deploymentName) { + return this.beginDeleteAtScopeAsync(scope, deploymentName).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtScope(String scope, String deploymentName, Context context) { + return this.beginDeleteAtScopeAsync(scope, deploymentName, context).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtScopeAsync(String scope, String deploymentName) { + return beginDeleteAtScopeAsync(scope, deploymentName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtScopeAsync(String scope, String deploymentName, Context context) { + return beginDeleteAtScopeAsync(scope, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtScope(String scope, String deploymentName) { + deleteAtScopeAsync(scope, deploymentName).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtScope(String scope, String deploymentName, Context context) { + deleteAtScopeAsync(scope, deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkExistenceAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtScopeWithResponseAsync( + String scope, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkExistenceAtScope( + this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAtScopeAsync(String scope, String deploymentName) { + return checkExistenceAtScopeWithResponseAsync(scope, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context) { + return checkExistenceAtScopeWithResponseAsync(scope, deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceAtScope(String scope, String deploymentName) { + return checkExistenceAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtScopeWithResponseAsync( + String scope, String deploymentName, Deployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtScopeWithResponseAsync( + String scope, String deploymentName, Deployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtScopeAsync( + String scope, String deploymentName, Deployment parameters) { + Mono>> mono = + createOrUpdateAtScopeWithResponseAsync(scope, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtScopeAsync( + String scope, String deploymentName, Deployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateAtScopeWithResponseAsync(scope, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + context); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters) { + return this.beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters, Context context) { + return this.beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtScopeAsync( + String scope, String deploymentName, Deployment parameters) { + return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtScopeAsync( + String scope, String deploymentName, Deployment parameters, Context context) { + return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploymentName, Deployment parameters) { + return createOrUpdateAtScopeAsync(scope, deploymentName, parameters).block(); + } + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters, Context context) { + return createOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).block(); + } + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtScopeWithResponseAsync(String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtScopeWithResponseAsync( + String scope, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtScopeAsync(String scope, String deploymentName) { + return getAtScopeWithResponseAsync(scope, deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtScopeWithResponse( + String scope, String deploymentName, Context context) { + return getAtScopeWithResponseAsync(scope, deploymentName, context).block(); + } + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getAtScope(String scope, String deploymentName) { + return getAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtScopeWithResponseAsync(String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancelAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtScopeWithResponseAsync(String scope, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancelAtScope( + this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAtScopeAsync(String scope, String deploymentName) { + return cancelAtScopeWithResponseAsync(scope, deploymentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cancelAtScopeWithResponse(String scope, String deploymentName, Context context) { + return cancelAtScopeWithResponseAsync(scope, deploymentName, context).block(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancelAtScope(String scope, String deploymentName) { + cancelAtScopeWithResponse(scope, deploymentName, Context.NONE); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtScopeWithResponseAsync( + String scope, String deploymentName, Deployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtScopeWithResponseAsync( + String scope, String deploymentName, Deployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtScopeAsync(String scope, String deploymentName, Deployment parameters) { + Mono>> mono = validateAtScopeWithResponseAsync(scope, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + this.client.getContext()); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtScopeAsync(String scope, String deploymentName, Deployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateAtScopeWithResponseAsync(scope, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( + String scope, String deploymentName, Deployment parameters) { + return this.beginValidateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> beginValidateAtScope( + String scope, String deploymentName, Deployment parameters, Context context) { + return this.beginValidateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtScopeAsync( + String scope, String deploymentName, Deployment parameters) { + return beginValidateAtScopeAsync(scope, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtScopeAsync( + String scope, String deploymentName, Deployment parameters, Context context) { + return beginValidateAtScopeAsync(scope, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName, Deployment parameters) { + return validateAtScopeAsync(scope, deploymentName, parameters).block(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtScope( + String scope, String deploymentName, Deployment parameters, Context context) { + return validateAtScopeAsync(scope, deploymentName, parameters, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtScopeWithResponseAsync( + String scope, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportTemplateAtScope( + this.client.getEndpoint(), + scope, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtScopeWithResponseAsync( + String scope, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportTemplateAtScope( + this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAtScopeAsync(String scope, String deploymentName) { + return exportTemplateAtScopeWithResponseAsync(scope, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtScopeWithResponse( + String scope, String deploymentName, Context context) { + return exportTemplateAtScopeWithResponseAsync(scope, deploymentName, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName) { + return exportTemplateAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue(); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeSinglePageAsync( + String scope, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAtScope( + this.client.getEndpoint(), + scope, + filter, + top, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeSinglePageAsync( + String scope, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtScope(this.client.getEndpoint(), scope, filter, top, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync(String scope, String filter, Integer top) { + return new PagedFlux<>( + () -> listAtScopeSinglePageAsync(scope, filter, top), nextLink -> listAtScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync(String scope) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listAtScopeSinglePageAsync(scope, filter, top), nextLink -> listAtScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtScopeAsync( + String scope, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtScopeSinglePageAsync(scope, filter, top, context), + nextLink -> listAtScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtScope(String scope) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAtScopeAsync(scope, filter, top)); + } + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtScope( + String scope, String filter, Integer top, Context context) { + return new PagedIterable<>(listAtScopeAsync(scope, filter, top, context)); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtTenantScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtTenantScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtTenantScopeAsync(String deploymentName) { + Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtTenantScopeAsync(String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtTenantScope(String deploymentName) { + return this.beginDeleteAtTenantScopeAsync(deploymentName).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtTenantScope(String deploymentName, Context context) { + return this.beginDeleteAtTenantScopeAsync(deploymentName, context).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtTenantScopeAsync(String deploymentName) { + return beginDeleteAtTenantScopeAsync(deploymentName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtTenantScopeAsync(String deploymentName, Context context) { + return beginDeleteAtTenantScopeAsync(deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtTenantScope(String deploymentName) { + deleteAtTenantScopeAsync(deploymentName).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtTenantScope(String deploymentName, Context context) { + deleteAtTenantScopeAsync(deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtTenantScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkExistenceAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtTenantScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkExistenceAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAtTenantScopeAsync(String deploymentName) { + return checkExistenceAtTenantScopeWithResponseAsync(deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context) { + return checkExistenceAtTenantScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceAtTenantScope(String deploymentName) { + return checkExistenceAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtTenantScopeWithResponseAsync( + String deploymentName, ScopedDeployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAtTenantScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtTenantScopeWithResponseAsync( + String deploymentName, ScopedDeployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters) { + Mono>> mono = + createOrUpdateAtTenantScopeWithResponseAsync(deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateAtTenantScopeWithResponseAsync(deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + context); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters) { + return this.beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context) { + return this.beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtTenantScopeAsync( + String deploymentName, ScopedDeployment parameters) { + return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtTenantScopeAsync( + String deploymentName, ScopedDeployment parameters, Context context) { + return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters) { + return createOrUpdateAtTenantScopeAsync(deploymentName, parameters).block(); + } + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context) { + return createOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).block(); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtTenantScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtTenantScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtTenantScopeAsync(String deploymentName) { + return getAtTenantScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtTenantScopeWithResponse(String deploymentName, Context context) { + return getAtTenantScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getAtTenantScope(String deploymentName) { + return getAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtTenantScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancelAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtTenantScopeWithResponseAsync(String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancelAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAtTenantScopeAsync(String deploymentName) { + return cancelAtTenantScopeWithResponseAsync(deploymentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cancelAtTenantScopeWithResponse(String deploymentName, Context context) { + return cancelAtTenantScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancelAtTenantScope(String deploymentName) { + cancelAtTenantScopeWithResponse(deploymentName, Context.NONE); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtTenantScopeWithResponseAsync( + String deploymentName, ScopedDeployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateAtTenantScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtTenantScopeWithResponseAsync( + String deploymentName, ScopedDeployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters) { + Mono>> mono = validateAtTenantScopeWithResponseAsync(deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + this.client.getContext()); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateAtTenantScopeWithResponseAsync(deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtTenantScope(String deploymentName, ScopedDeployment parameters) { + return this.beginValidateAtTenantScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtTenantScope(String deploymentName, ScopedDeployment parameters, Context context) { + return this.beginValidateAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtTenantScopeAsync( + String deploymentName, ScopedDeployment parameters) { + return beginValidateAtTenantScopeAsync(deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtTenantScopeAsync( + String deploymentName, ScopedDeployment parameters, Context context) { + return beginValidateAtTenantScopeAsync(deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtTenantScope(String deploymentName, ScopedDeployment parameters) { + return validateAtTenantScopeAsync(deploymentName, parameters).block(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context) { + return validateAtTenantScopeAsync(deploymentName, parameters, context).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfAtTenantScopeWithResponseAsync( + String deploymentName, ScopedDeploymentWhatIf parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .whatIfAtTenantScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfAtTenantScopeWithResponseAsync( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .whatIfAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtTenantScopeAsync(String deploymentName, ScopedDeploymentWhatIf parameters) { + Mono>> mono = whatIfAtTenantScopeWithResponseAsync(deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + this.client.getContext()); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtTenantScopeAsync(String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + whatIfAtTenantScopeWithResponseAsync(deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters) { + return this.beginWhatIfAtTenantScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> beginWhatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + return this.beginWhatIfAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtTenantScopeAsync( + String deploymentName, ScopedDeploymentWhatIf parameters) { + return beginWhatIfAtTenantScopeAsync(deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtTenantScopeAsync( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + return beginWhatIfAtTenantScopeAsync(deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters) { + return whatIfAtTenantScopeAsync(deploymentName, parameters).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + return whatIfAtTenantScopeAsync(deploymentName, parameters, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtTenantScopeWithResponseAsync( + String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportTemplateAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtTenantScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportTemplateAtTenantScope( + this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAtTenantScopeAsync(String deploymentName) { + return exportTemplateAtTenantScopeWithResponseAsync(deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtTenantScopeWithResponse( + String deploymentName, Context context) { + return exportTemplateAtTenantScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtTenantScope(String deploymentName) { + return exportTemplateAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync(String filter, Integer top) { + 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 + .listAtTenantScope( + this.client.getEndpoint(), filter, top, this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync( + String filter, Integer top, 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 + .listAtTenantScope(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String filter, Integer top) { + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(filter, top), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments at the tenant scope. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(filter, top), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(filter, top, context), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the deployments at the tenant scope. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAtTenantScopeAsync(filter, top)); + } + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope(String filter, Integer top, Context context) { + return new PagedIterable<>(listAtTenantScopeAsync(filter, top, context)); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteAtManagementGroupScope( + this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtManagementGroupScopeAsync( + String groupId, String deploymentName) { + Mono>> mono = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtManagementGroupScopeAsync( + String groupId, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtManagementGroupScope(String groupId, String deploymentName) { + return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtManagementGroupScope( + String groupId, String deploymentName, Context context) { + return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtManagementGroupScopeAsync(String groupId, String deploymentName, Context context) { + return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtManagementGroupScope(String groupId, String deploymentName) { + deleteAtManagementGroupScopeAsync(groupId, deploymentName).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtManagementGroupScope(String groupId, String deploymentName, Context context) { + deleteAtManagementGroupScopeAsync(groupId, deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkExistenceAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkExistenceAtManagementGroupScope( + this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return checkExistenceAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + return checkExistenceAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName) { + return checkExistenceAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, ScopedDeployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters) { + Mono>> mono = + createOrUpdateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + context); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) { + return this.beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + return this + .beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .getSyncPoller(); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters) { + return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters) { + return createOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); + } + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + return createOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); + } + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtManagementGroupScope( + this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + } + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName) { + return getAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .cancelAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .cancelAtManagementGroupScope( + this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAtManagementGroupScopeAsync(String groupId, String deploymentName) { + return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cancelAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancelAtManagementGroupScope(String groupId, String deploymentName) { + cancelAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, ScopedDeployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters) { + Mono>> mono = + validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + this.client.getContext()); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) { + return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + return this + .beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters) { + return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters) { + return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .whatIfAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .whatIfAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + Mono>> mono = + whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + this.client.getContext()); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> + beginWhatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + return this + .beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtManagementGroupScopeAsync( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportTemplateAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + deploymentName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtManagementGroupScopeWithResponseAsync( + String groupId, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportTemplateAtManagementGroupScope( + this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAtManagementGroupScopeAsync( + String groupId, String deploymentName) { + return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName) { + return exportTemplateAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue(); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeSinglePageAsync( + String groupId, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listAtManagementGroupScope( + this.client.getEndpoint(), + groupId, + filter, + top, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeSinglePageAsync( + String groupId, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listAtManagementGroupScope( + this.client.getEndpoint(), groupId, filter, top, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync( + String groupId, String filter, Integer top) { + return new PagedFlux<>( + () -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync(String groupId) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtManagementGroupScopeAsync( + String groupId, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listAtManagementGroupScopeSinglePageAsync(groupId, filter, top, context), + nextLink -> listAtManagementGroupScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroupScope(String groupId) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top)); + } + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtManagementGroupScope( + String groupId, String filter, Integer top, Context context) { + return new PagedIterable<>(listAtManagementGroupScopeAsync(groupId, filter, top, context)); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtSubscriptionScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .deleteAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtSubscriptionScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .deleteAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtSubscriptionScopeAsync(String deploymentName) { + Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtSubscriptionScopeAsync( + String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteAtSubscriptionScopeWithResponseAsync(deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtSubscriptionScope(String deploymentName) { + return this.beginDeleteAtSubscriptionScopeAsync(deploymentName).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtSubscriptionScope(String deploymentName, Context context) { + return this.beginDeleteAtSubscriptionScopeAsync(deploymentName, context).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtSubscriptionScopeAsync(String deploymentName) { + return beginDeleteAtSubscriptionScopeAsync(deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtSubscriptionScopeAsync(String deploymentName, Context context) { + return beginDeleteAtSubscriptionScopeAsync(deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtSubscriptionScope(String deploymentName) { + deleteAtSubscriptionScopeAsync(deploymentName).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtSubscriptionScope(String deploymentName, Context context) { + deleteAtSubscriptionScopeAsync(deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtSubscriptionScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .checkExistenceAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceAtSubscriptionScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .checkExistenceAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAtSubscriptionScopeAsync(String deploymentName) { + return checkExistenceAtSubscriptionScopeWithResponseAsync(deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context) { + return checkExistenceAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceAtSubscriptionScope(String deploymentName) { + return checkExistenceAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync( + String deploymentName, Deployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtSubscriptionScopeWithResponseAsync( + String deploymentName, Deployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, Deployment parameters) { + Mono>> mono = + createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScopeAsync(String deploymentName, Deployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + context); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters) { + return this.beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> + beginCreateOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters, Context context) { + return this.beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtSubscriptionScopeAsync( + String deploymentName, Deployment parameters) { + return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtSubscriptionScopeAsync( + String deploymentName, Deployment parameters, Context context) { + return beginCreateOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters) { + return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters).block(); + } + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context) { + return createOrUpdateAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtSubscriptionScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .getAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtSubscriptionScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .getAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtSubscriptionScopeAsync(String deploymentName) { + return getAtSubscriptionScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtSubscriptionScopeWithResponse( + String deploymentName, Context context) { + return getAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getAtSubscriptionScope(String deploymentName) { + return getAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtSubscriptionScopeWithResponseAsync(String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .cancelAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelAtSubscriptionScopeWithResponseAsync(String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .cancelAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAtSubscriptionScopeAsync(String deploymentName) { + return cancelAtSubscriptionScopeWithResponseAsync(deploymentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cancelAtSubscriptionScopeWithResponse(String deploymentName, Context context) { + return cancelAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancelAtSubscriptionScope(String deploymentName) { + cancelAtSubscriptionScopeWithResponse(deploymentName, Context.NONE); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtSubscriptionScopeWithResponseAsync( + String deploymentName, Deployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateAtSubscriptionScopeWithResponseAsync( + String deploymentName, Deployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtSubscriptionScopeAsync(String deploymentName, Deployment parameters) { + Mono>> mono = + validateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + this.client.getContext()); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> + beginValidateAtSubscriptionScopeAsync(String deploymentName, Deployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtSubscriptionScope(String deploymentName, Deployment parameters) { + return this.beginValidateAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> + beginValidateAtSubscriptionScope(String deploymentName, Deployment parameters, Context context) { + return this.beginValidateAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtSubscriptionScopeAsync( + String deploymentName, Deployment parameters) { + return beginValidateAtSubscriptionScopeAsync(deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAtSubscriptionScopeAsync( + String deploymentName, Deployment parameters, Context context) { + return beginValidateAtSubscriptionScopeAsync(deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtSubscriptionScope(String deploymentName, Deployment parameters) { + return validateAtSubscriptionScopeAsync(deploymentName, parameters).block(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context) { + return validateAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfAtSubscriptionScopeWithResponseAsync( + String deploymentName, DeploymentWhatIf parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .whatIfAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfAtSubscriptionScopeWithResponseAsync( + String deploymentName, DeploymentWhatIf parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .whatIfAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtSubscriptionScopeAsync(String deploymentName, DeploymentWhatIf parameters) { + Mono>> mono = whatIfAtSubscriptionScopeWithResponseAsync(deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + this.client.getContext()); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> + beginWhatIfAtSubscriptionScopeAsync(String deploymentName, DeploymentWhatIf parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + whatIfAtSubscriptionScopeWithResponseAsync(deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> + beginWhatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters) { + return this.beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> + beginWhatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters, Context context) { + return this.beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtSubscriptionScopeAsync( + String deploymentName, DeploymentWhatIf parameters) { + return beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAtSubscriptionScopeAsync( + String deploymentName, DeploymentWhatIf parameters, Context context) { + return beginWhatIfAtSubscriptionScopeAsync(deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters) { + return whatIfAtSubscriptionScopeAsync(deploymentName, parameters).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIfAtSubscriptionScope( + String deploymentName, DeploymentWhatIf parameters, Context context) { + return whatIfAtSubscriptionScopeAsync(deploymentName, parameters, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtSubscriptionScopeWithResponseAsync( + String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .exportTemplateAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateAtSubscriptionScopeWithResponseAsync( + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .exportTemplateAtSubscriptionScope( + this.client.getEndpoint(), + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAtSubscriptionScopeAsync(String deploymentName) { + return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateAtSubscriptionScopeWithResponse( + String deploymentName, Context context) { + return exportTemplateAtSubscriptionScopeWithResponseAsync(deploymentName, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplateAtSubscriptionScope(String deploymentName) { + return exportTemplateAtSubscriptionScopeWithResponse(deploymentName, Context.NONE).getValue(); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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(), + filter, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Integer top, 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(), + filter, + top, + 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)); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, context), + nextLink -> listAtSubscriptionScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the deployments for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deploymentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 deploymentName) { + return this.beginDeleteAsync(resourceGroupName, deploymentName).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 deploymentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, deploymentName, context).getSyncPoller(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deploymentName) { + return beginDeleteAsync(resourceGroupName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deploymentName) { + deleteAsync(resourceGroupName, deploymentName).block(); + } + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deploymentName, Context context) { + deleteAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync(String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .checkExistence( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .checkExistence( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAsync(String resourceGroupName, String deploymentName) { + return checkExistenceWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceWithResponse( + String resourceGroupName, String deploymentName, Context context) { + return checkExistenceWithResponseAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistence(String resourceGroupName, String deploymentName) { + return checkExistenceWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String deploymentName, Deployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deploymentName, Deployment parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + this.client.getContext()); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAsync( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentExtendedInner.class, + DeploymentExtendedInner.class, + context); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentExtendedInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String deploymentName, Deployment parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters) { + return createOrUpdateAsync(resourceGroupName, deploymentName, parameters).block(); + } + + /** + * Deploys resources to a resource group. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case insensitive. + * The resource group must already exist. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner createOrUpdate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, deploymentName, parameters, context).block(); + } + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .getByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String deploymentName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExtendedInner getByResourceGroup(String resourceGroupName, String deploymentName) { + return getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelWithResponseAsync(String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .cancel( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> cancelWithResponseAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .cancel( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cancelAsync(String resourceGroupName, String deploymentName) { + return cancelWithResponseAsync(resourceGroupName, deploymentName).flatMap(ignored -> Mono.empty()); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 cancelWithResponse(String resourceGroupName, String deploymentName, Context context) { + return cancelWithResponseAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cancel(String resourceGroupName, String deploymentName) { + cancelWithResponse(resourceGroupName, deploymentName, Context.NONE); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, String deploymentName, Deployment parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> beginValidateAsync( + String resourceGroupName, String deploymentName, Deployment parameters) { + Mono>> mono = + validateWithResponseAsync(resourceGroupName, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + this.client.getContext()); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentValidateResultInner> beginValidateAsync( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateWithResponseAsync(resourceGroupName, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentValidateResultInner.class, + DeploymentValidateResultInner.class, + context); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> beginValidate( + String resourceGroupName, String deploymentName, Deployment parameters) { + return this.beginValidateAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentValidateResultInner> beginValidate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + return this.beginValidateAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, String deploymentName, Deployment parameters) { + return beginValidateAsync(resourceGroupName, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + return beginValidateAsync(resourceGroupName, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validate( + String resourceGroupName, String deploymentName, Deployment parameters) { + return validateAsync(resourceGroupName, deploymentName, parameters).block(); + } + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentValidateResultInner validate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + return validateAsync(resourceGroupName, deploymentName, parameters, context).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfWithResponseAsync( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .whatIf( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> whatIfWithResponseAsync( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .whatIf( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> beginWhatIfAsync( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { + Mono>> mono = whatIfWithResponseAsync(resourceGroupName, deploymentName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + this.client.getContext()); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, WhatIfOperationResultInner> beginWhatIfAsync( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + whatIfWithResponseAsync(resourceGroupName, deploymentName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WhatIfOperationResultInner.class, + WhatIfOperationResultInner.class, + context); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> beginWhatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { + return this.beginWhatIfAsync(resourceGroupName, deploymentName, parameters).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, WhatIfOperationResultInner> beginWhatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { + return this.beginWhatIfAsync(resourceGroupName, deploymentName, parameters, context).getSyncPoller(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAsync( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { + return beginWhatIfAsync(resourceGroupName, deploymentName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono whatIfAsync( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { + return beginWhatIfAsync(resourceGroupName, deploymentName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { + return whatIfAsync(resourceGroupName, deploymentName, parameters).block(); + } + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WhatIfOperationResultInner whatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { + return whatIfAsync(resourceGroupName, deploymentName, parameters, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateWithResponseAsync( + String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .exportTemplate( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportTemplateWithResponseAsync( + String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required 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 + .exportTemplate( + this.client.getEndpoint(), + resourceGroupName, + deploymentName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAsync(String resourceGroupName, String deploymentName) { + return exportTemplateWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportTemplateWithResponse( + String resourceGroupName, String deploymentName, Context context) { + return exportTemplateWithResponseAsync(resourceGroupName, deploymentName, context).block(); + } + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentExportResultInner exportTemplate(String resourceGroupName, String deploymentName) { + return exportTemplateWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + filter, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + filter, + top, + 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)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); + } + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> calculateTemplateHashWithResponseAsync(Object template) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (template == null) { + return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .calculateTemplateHash( + this.client.getEndpoint(), this.client.getApiVersion(), template, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> calculateTemplateHashWithResponseAsync( + Object template, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (template == null) { + return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .calculateTemplateHash(this.client.getEndpoint(), this.client.getApiVersion(), template, accept, context); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono calculateTemplateHashAsync(Object template) { + return calculateTemplateHashWithResponseAsync(template).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response calculateTemplateHashWithResponse(Object template, Context context) { + return calculateTemplateHashWithResponseAsync(template, context).block(); + } + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TemplateHashResultInner calculateTemplateHash(Object template) { + return calculateTemplateHashWithResponse(template, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeNextSinglePageAsync(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.listAtScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtScopeNextSinglePageAsync( + 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 + .listAtScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeNextSinglePageAsync(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.listAtTenantScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeNextSinglePageAsync( + 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 + .listAtTenantScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeNextSinglePageAsync( + 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.listAtManagementGroupScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtManagementGroupScopeNextSinglePageAsync( + 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 + .listAtManagementGroupScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeNextSinglePageAsync(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.listAtSubscriptionScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtSubscriptionScopeNextSinglePageAsync( + 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 + .listAtSubscriptionScopeNext(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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of deployments 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsImpl.java new file mode 100644 index 0000000000000..6125da33fd3bf --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/DeploymentsImpl.java @@ -0,0 +1,836 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.DeploymentsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExportResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExtendedInner; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentValidateResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TemplateHashResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.WhatIfOperationResultInner; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentExportResult; +import com.azure.resourcemanager.resources.generated.models.DeploymentExtended; +import com.azure.resourcemanager.resources.generated.models.DeploymentValidateResult; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.Deployments; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.TemplateHashResult; +import com.azure.resourcemanager.resources.generated.models.WhatIfOperationResult; + +public final class DeploymentsImpl implements Deployments { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentsImpl.class); + + private final DeploymentsClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public DeploymentsImpl( + DeploymentsClient innerClient, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void deleteAtScope(String scope, String deploymentName) { + this.serviceClient().deleteAtScope(scope, deploymentName); + } + + public void deleteAtScope(String scope, String deploymentName, Context context) { + this.serviceClient().deleteAtScope(scope, deploymentName, context); + } + + public Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context) { + return this.serviceClient().checkExistenceAtScopeWithResponse(scope, deploymentName, context); + } + + public boolean checkExistenceAtScope(String scope, String deploymentName) { + return this.serviceClient().checkExistenceAtScope(scope, deploymentName); + } + + public DeploymentExtended createOrUpdateAtScope(String scope, String deploymentName, Deployment parameters) { + DeploymentExtendedInner inner = this.serviceClient().createOrUpdateAtScope(scope, deploymentName, parameters); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentExtended createOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters, Context context) { + DeploymentExtendedInner inner = + this.serviceClient().createOrUpdateAtScope(scope, deploymentName, parameters, context); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAtScopeWithResponse(String scope, String deploymentName, Context context) { + Response inner = + this.serviceClient().getAtScopeWithResponse(scope, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExtendedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExtended getAtScope(String scope, String deploymentName) { + DeploymentExtendedInner inner = this.serviceClient().getAtScope(scope, deploymentName); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelAtScopeWithResponse(String scope, String deploymentName, Context context) { + return this.serviceClient().cancelAtScopeWithResponse(scope, deploymentName, context); + } + + public void cancelAtScope(String scope, String deploymentName) { + this.serviceClient().cancelAtScope(scope, deploymentName); + } + + public DeploymentValidateResult validateAtScope(String scope, String deploymentName, Deployment parameters) { + DeploymentValidateResultInner inner = this.serviceClient().validateAtScope(scope, deploymentName, parameters); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentValidateResult validateAtScope( + String scope, String deploymentName, Deployment parameters, Context context) { + DeploymentValidateResultInner inner = + this.serviceClient().validateAtScope(scope, deploymentName, parameters, context); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response exportTemplateAtScopeWithResponse( + String scope, String deploymentName, Context context) { + Response inner = + this.serviceClient().exportTemplateAtScopeWithResponse(scope, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExportResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExportResult exportTemplateAtScope(String scope, String deploymentName) { + DeploymentExportResultInner inner = this.serviceClient().exportTemplateAtScope(scope, deploymentName); + if (inner != null) { + return new DeploymentExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtScope(String scope) { + PagedIterable inner = this.serviceClient().listAtScope(scope); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public PagedIterable listAtScope(String scope, String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().listAtScope(scope, filter, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public void deleteAtTenantScope(String deploymentName) { + this.serviceClient().deleteAtTenantScope(deploymentName); + } + + public void deleteAtTenantScope(String deploymentName, Context context) { + this.serviceClient().deleteAtTenantScope(deploymentName, context); + } + + public Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context) { + return this.serviceClient().checkExistenceAtTenantScopeWithResponse(deploymentName, context); + } + + public boolean checkExistenceAtTenantScope(String deploymentName) { + return this.serviceClient().checkExistenceAtTenantScope(deploymentName); + } + + public DeploymentExtended createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters) { + DeploymentExtendedInner inner = this.serviceClient().createOrUpdateAtTenantScope(deploymentName, parameters); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentExtended createOrUpdateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context) { + DeploymentExtendedInner inner = + this.serviceClient().createOrUpdateAtTenantScope(deploymentName, parameters, context); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAtTenantScopeWithResponse(String deploymentName, Context context) { + Response inner = + this.serviceClient().getAtTenantScopeWithResponse(deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExtendedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExtended getAtTenantScope(String deploymentName) { + DeploymentExtendedInner inner = this.serviceClient().getAtTenantScope(deploymentName); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelAtTenantScopeWithResponse(String deploymentName, Context context) { + return this.serviceClient().cancelAtTenantScopeWithResponse(deploymentName, context); + } + + public void cancelAtTenantScope(String deploymentName) { + this.serviceClient().cancelAtTenantScope(deploymentName); + } + + public DeploymentValidateResult validateAtTenantScope(String deploymentName, ScopedDeployment parameters) { + DeploymentValidateResultInner inner = this.serviceClient().validateAtTenantScope(deploymentName, parameters); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentValidateResult validateAtTenantScope( + String deploymentName, ScopedDeployment parameters, Context context) { + DeploymentValidateResultInner inner = + this.serviceClient().validateAtTenantScope(deploymentName, parameters, context); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters) { + WhatIfOperationResultInner inner = this.serviceClient().whatIfAtTenantScope(deploymentName, parameters); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + WhatIfOperationResultInner inner = + this.serviceClient().whatIfAtTenantScope(deploymentName, parameters, context); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response exportTemplateAtTenantScopeWithResponse( + String deploymentName, Context context) { + Response inner = + this.serviceClient().exportTemplateAtTenantScopeWithResponse(deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExportResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExportResult exportTemplateAtTenantScope(String deploymentName) { + DeploymentExportResultInner inner = this.serviceClient().exportTemplateAtTenantScope(deploymentName); + if (inner != null) { + return new DeploymentExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtTenantScope() { + PagedIterable inner = this.serviceClient().listAtTenantScope(); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public PagedIterable listAtTenantScope(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().listAtTenantScope(filter, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public void deleteAtManagementGroupScope(String groupId, String deploymentName) { + this.serviceClient().deleteAtManagementGroupScope(groupId, deploymentName); + } + + public void deleteAtManagementGroupScope(String groupId, String deploymentName, Context context) { + this.serviceClient().deleteAtManagementGroupScope(groupId, deploymentName, context); + } + + public Response checkExistenceAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + return this.serviceClient().checkExistenceAtManagementGroupScopeWithResponse(groupId, deploymentName, context); + } + + public boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName) { + return this.serviceClient().checkExistenceAtManagementGroupScope(groupId, deploymentName); + } + + public DeploymentExtended createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters) { + DeploymentExtendedInner inner = + this.serviceClient().createOrUpdateAtManagementGroupScope(groupId, deploymentName, parameters); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentExtended createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + DeploymentExtendedInner inner = + this.serviceClient().createOrUpdateAtManagementGroupScope(groupId, deploymentName, parameters, context); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + Response inner = + this.serviceClient().getAtManagementGroupScopeWithResponse(groupId, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExtendedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExtended getAtManagementGroupScope(String groupId, String deploymentName) { + DeploymentExtendedInner inner = this.serviceClient().getAtManagementGroupScope(groupId, deploymentName); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + return this.serviceClient().cancelAtManagementGroupScopeWithResponse(groupId, deploymentName, context); + } + + public void cancelAtManagementGroupScope(String groupId, String deploymentName) { + this.serviceClient().cancelAtManagementGroupScope(groupId, deploymentName); + } + + public DeploymentValidateResult validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters) { + DeploymentValidateResultInner inner = + this.serviceClient().validateAtManagementGroupScope(groupId, deploymentName, parameters); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentValidateResult validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context) { + DeploymentValidateResultInner inner = + this.serviceClient().validateAtManagementGroupScope(groupId, deploymentName, parameters, context); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) { + WhatIfOperationResultInner inner = + this.serviceClient().whatIfAtManagementGroupScope(groupId, deploymentName, parameters); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context) { + WhatIfOperationResultInner inner = + this.serviceClient().whatIfAtManagementGroupScope(groupId, deploymentName, parameters, context); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response exportTemplateAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context) { + Response inner = + this.serviceClient().exportTemplateAtManagementGroupScopeWithResponse(groupId, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExportResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExportResult exportTemplateAtManagementGroupScope(String groupId, String deploymentName) { + DeploymentExportResultInner inner = + this.serviceClient().exportTemplateAtManagementGroupScope(groupId, deploymentName); + if (inner != null) { + return new DeploymentExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listAtManagementGroupScope(String groupId) { + PagedIterable inner = this.serviceClient().listAtManagementGroupScope(groupId); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public PagedIterable listAtManagementGroupScope( + String groupId, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listAtManagementGroupScope(groupId, filter, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public void deleteAtSubscriptionScope(String deploymentName) { + this.serviceClient().deleteAtSubscriptionScope(deploymentName); + } + + public void deleteAtSubscriptionScope(String deploymentName, Context context) { + this.serviceClient().deleteAtSubscriptionScope(deploymentName, context); + } + + public Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context) { + return this.serviceClient().checkExistenceAtSubscriptionScopeWithResponse(deploymentName, context); + } + + public boolean checkExistenceAtSubscriptionScope(String deploymentName) { + return this.serviceClient().checkExistenceAtSubscriptionScope(deploymentName); + } + + public DeploymentExtended createOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters) { + DeploymentExtendedInner inner = + this.serviceClient().createOrUpdateAtSubscriptionScope(deploymentName, parameters); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentExtended createOrUpdateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context) { + DeploymentExtendedInner inner = + this.serviceClient().createOrUpdateAtSubscriptionScope(deploymentName, parameters, context); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAtSubscriptionScopeWithResponse(String deploymentName, Context context) { + Response inner = + this.serviceClient().getAtSubscriptionScopeWithResponse(deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExtendedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExtended getAtSubscriptionScope(String deploymentName) { + DeploymentExtendedInner inner = this.serviceClient().getAtSubscriptionScope(deploymentName); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelAtSubscriptionScopeWithResponse(String deploymentName, Context context) { + return this.serviceClient().cancelAtSubscriptionScopeWithResponse(deploymentName, context); + } + + public void cancelAtSubscriptionScope(String deploymentName) { + this.serviceClient().cancelAtSubscriptionScope(deploymentName); + } + + public DeploymentValidateResult validateAtSubscriptionScope(String deploymentName, Deployment parameters) { + DeploymentValidateResultInner inner = + this.serviceClient().validateAtSubscriptionScope(deploymentName, parameters); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentValidateResult validateAtSubscriptionScope( + String deploymentName, Deployment parameters, Context context) { + DeploymentValidateResultInner inner = + this.serviceClient().validateAtSubscriptionScope(deploymentName, parameters, context); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters) { + WhatIfOperationResultInner inner = this.serviceClient().whatIfAtSubscriptionScope(deploymentName, parameters); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIfAtSubscriptionScope( + String deploymentName, DeploymentWhatIf parameters, Context context) { + WhatIfOperationResultInner inner = + this.serviceClient().whatIfAtSubscriptionScope(deploymentName, parameters, context); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response exportTemplateAtSubscriptionScopeWithResponse( + String deploymentName, Context context) { + Response inner = + this.serviceClient().exportTemplateAtSubscriptionScopeWithResponse(deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExportResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExportResult exportTemplateAtSubscriptionScope(String deploymentName) { + DeploymentExportResultInner inner = this.serviceClient().exportTemplateAtSubscriptionScope(deploymentName); + if (inner != null) { + return new DeploymentExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public void deleteByResourceGroup(String resourceGroupName, String deploymentName) { + this.serviceClient().delete(resourceGroupName, deploymentName); + } + + public void delete(String resourceGroupName, String deploymentName, Context context) { + this.serviceClient().delete(resourceGroupName, deploymentName, context); + } + + public Response checkExistenceWithResponse( + String resourceGroupName, String deploymentName, Context context) { + return this.serviceClient().checkExistenceWithResponse(resourceGroupName, deploymentName, context); + } + + public boolean checkExistence(String resourceGroupName, String deploymentName) { + return this.serviceClient().checkExistence(resourceGroupName, deploymentName); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExtendedImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExtended getByResourceGroup(String resourceGroupName, String deploymentName) { + DeploymentExtendedInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, deploymentName); + if (inner != null) { + return new DeploymentExtendedImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response cancelWithResponse(String resourceGroupName, String deploymentName, Context context) { + return this.serviceClient().cancelWithResponse(resourceGroupName, deploymentName, context); + } + + public void cancel(String resourceGroupName, String deploymentName) { + this.serviceClient().cancel(resourceGroupName, deploymentName); + } + + public DeploymentValidateResult validate(String resourceGroupName, String deploymentName, Deployment parameters) { + DeploymentValidateResultInner inner = + this.serviceClient().validate(resourceGroupName, deploymentName, parameters); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentValidateResult validate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context) { + DeploymentValidateResultInner inner = + this.serviceClient().validate(resourceGroupName, deploymentName, parameters, context); + if (inner != null) { + return new DeploymentValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIf(String resourceGroupName, String deploymentName, DeploymentWhatIf parameters) { + WhatIfOperationResultInner inner = this.serviceClient().whatIf(resourceGroupName, deploymentName, parameters); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public WhatIfOperationResult whatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context) { + WhatIfOperationResultInner inner = + this.serviceClient().whatIf(resourceGroupName, deploymentName, parameters, context); + if (inner != null) { + return new WhatIfOperationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response exportTemplateWithResponse( + String resourceGroupName, String deploymentName, Context context) { + Response inner = + this.serviceClient().exportTemplateWithResponse(resourceGroupName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentExportResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentExportResult exportTemplate(String resourceGroupName, String deploymentName) { + DeploymentExportResultInner inner = this.serviceClient().exportTemplate(resourceGroupName, deploymentName); + if (inner != null) { + return new DeploymentExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new DeploymentExtendedImpl(inner1, this.manager())); + } + + public Response calculateTemplateHashWithResponse(Object template, Context context) { + Response inner = + this.serviceClient().calculateTemplateHashWithResponse(template, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TemplateHashResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TemplateHashResult calculateTemplateHash(Object template) { + TemplateHashResultInner inner = this.serviceClient().calculateTemplateHash(template); + if (inner != null) { + return new TemplateHashResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public DeploymentExtended getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, deploymentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + this.delete(resourceGroupName, deploymentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + this.delete(resourceGroupName, deploymentName, context); + } + + private DeploymentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } + + public DeploymentExtendedImpl define(String name) { + return new DeploymentExtendedImpl(name, this.manager()); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceExpandedImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceExpandedImpl.java new file mode 100644 index 0000000000000..04dbd46c25e7a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceExpandedImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceExpandedInner; +import com.azure.resourcemanager.resources.generated.models.ExtendedLocation; +import com.azure.resourcemanager.resources.generated.models.GenericResourceExpanded; +import com.azure.resourcemanager.resources.generated.models.Identity; +import com.azure.resourcemanager.resources.generated.models.Plan; +import com.azure.resourcemanager.resources.generated.models.Sku; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class GenericResourceExpandedImpl implements GenericResourceExpanded { + private GenericResourceExpandedInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + GenericResourceExpandedImpl( + GenericResourceExpandedInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String managedBy() { + return this.innerModel().managedBy(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public OffsetDateTime createdTime() { + return this.innerModel().createdTime(); + } + + public OffsetDateTime changedTime() { + return this.innerModel().changedTime(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public GenericResourceExpandedInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceImpl.java new file mode 100644 index 0000000000000..54df0b292fdea --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/GenericResourceImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner; +import com.azure.resourcemanager.resources.generated.models.ExtendedLocation; +import com.azure.resourcemanager.resources.generated.models.GenericResource; +import com.azure.resourcemanager.resources.generated.models.Identity; +import com.azure.resourcemanager.resources.generated.models.Plan; +import com.azure.resourcemanager.resources.generated.models.Sku; +import java.util.Collections; +import java.util.Map; + +public final class GenericResourceImpl implements GenericResource { + private GenericResourceInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + GenericResourceImpl( + GenericResourceInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Plan plan() { + return this.innerModel().plan(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String managedBy() { + return this.innerModel().managedBy(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + + public GenericResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationImpl.java new file mode 100644 index 0000000000000..d5e7b6715a61b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.resources.generated.models.Operation; +import com.azure.resourcemanager.resources.generated.models.OperationDisplay; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..05852713dc7ef --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.OperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.resources.generated.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 ResourceManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Resources/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); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations 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 + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..164c3f3af5fca --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/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.resources.generated.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.resources.generated.fluent.OperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.OperationInner; +import com.azure.resourcemanager.resources.generated.models.Operation; +import com.azure.resourcemanager.resources.generated.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.resources.generated.ResourceManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderImpl.java new file mode 100644 index 0000000000000..c4ab9670f59e7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import com.azure.resourcemanager.resources.generated.models.Provider; +import com.azure.resourcemanager.resources.generated.models.ProviderAuthorizationConsentState; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceType; +import java.util.Collections; +import java.util.List; + +public final class ProviderImpl implements Provider { + private ProviderInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + ProviderImpl( + ProviderInner innerObject, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String namespace() { + return this.innerModel().namespace(); + } + + public String registrationState() { + return this.innerModel().registrationState(); + } + + public String registrationPolicy() { + return this.innerModel().registrationPolicy(); + } + + public List resourceTypes() { + List inner = this.innerModel().resourceTypes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProviderAuthorizationConsentState providerAuthorizationConsentState() { + return this.innerModel().providerAuthorizationConsentState(); + } + + public ProviderInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderPermissionListResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderPermissionListResultImpl.java new file mode 100644 index 0000000000000..2c8577ca866bd --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderPermissionListResultImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderPermissionListResultInner; +import com.azure.resourcemanager.resources.generated.models.ProviderPermission; +import com.azure.resourcemanager.resources.generated.models.ProviderPermissionListResult; +import java.util.Collections; +import java.util.List; + +public final class ProviderPermissionListResultImpl implements ProviderPermissionListResult { + private ProviderPermissionListResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + ProviderPermissionListResultImpl( + ProviderPermissionListResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ProviderPermissionListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypeListResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypeListResultImpl.java new file mode 100644 index 0000000000000..e2a5f4449fff5 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypeListResultImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderResourceTypeListResultInner; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceType; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceTypeListResult; +import java.util.Collections; +import java.util.List; + +public final class ProviderResourceTypeListResultImpl implements ProviderResourceTypeListResult { + private ProviderResourceTypeListResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + ProviderResourceTypeListResultImpl( + ProviderResourceTypeListResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ProviderResourceTypeListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesClientImpl.java new file mode 100644 index 0000000000000..4cedf28b27ba0 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesClientImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.resources.generated.fluent.ProviderResourceTypesClient; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderResourceTypeListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProviderResourceTypesClient. */ +public final class ProviderResourceTypesClientImpl implements ProviderResourceTypesClient { + /** The proxy service used to perform REST calls. */ + private final ProviderResourceTypesService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of ProviderResourceTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProviderResourceTypesClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy + .create(ProviderResourceTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientProviderResourceTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface ProviderResourceTypesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/resourceTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceProviderNamespace, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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(), + expand, + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceProviderNamespace, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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(), + expand, + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceProviderNamespace) { + final String expand = null; + return listWithResponseAsync(resourceProviderNamespace, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceProviderNamespace, String expand, Context context) { + return listWithResponseAsync(resourceProviderNamespace, expand, context).block(); + } + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderResourceTypeListResultInner list(String resourceProviderNamespace) { + final String expand = null; + return listWithResponse(resourceProviderNamespace, expand, Context.NONE).getValue(); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesImpl.java new file mode 100644 index 0000000000000..9e82cdea57edc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProviderResourceTypesImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.resources.generated.fluent.ProviderResourceTypesClient; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderResourceTypeListResultInner; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceTypeListResult; +import com.azure.resourcemanager.resources.generated.models.ProviderResourceTypes; + +public final class ProviderResourceTypesImpl implements ProviderResourceTypes { + private static final ClientLogger LOGGER = new ClientLogger(ProviderResourceTypesImpl.class); + + private final ProviderResourceTypesClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public ProviderResourceTypesImpl( + ProviderResourceTypesClient innerClient, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse( + String resourceProviderNamespace, String expand, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceProviderNamespace, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderResourceTypeListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProviderResourceTypeListResult list(String resourceProviderNamespace) { + ProviderResourceTypeListResultInner inner = this.serviceClient().list(resourceProviderNamespace); + if (inner != null) { + return new ProviderResourceTypeListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProviderResourceTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersClientImpl.java new file mode 100644 index 0000000000000..40fd6a6521be1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersClientImpl.java @@ -0,0 +1,1478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.resources.generated.fluent.ProvidersClient; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderPermissionListResultInner; +import com.azure.resourcemanager.resources.generated.models.ProviderListResult; +import com.azure.resourcemanager.resources.generated.models.ProviderRegistrationRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ProvidersClient. */ +public final class ProvidersClientImpl implements ProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ProvidersService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of ProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProvidersClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy.create(ProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface ProvidersService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> unregister( + @HostParam("$host") String endpoint, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Management/managementGroups/{groupId}/providers/{resourceProviderNamespace}/register") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> registerAtManagementGroupScope( + @HostParam("$host") String endpoint, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @PathParam("groupId") String groupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/providerPermissions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> providerPermissions( + @HostParam("$host") String endpoint, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> register( + @HostParam("$host") String endpoint, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ProviderRegistrationRequest properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtTenantScope( + @HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/{resourceProviderNamespace}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtTenantScope( + @HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAtTenantScopeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unregisterWithResponseAsync(String resourceProviderNamespace) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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 + .unregister( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> unregisterWithResponseAsync( + String resourceProviderNamespace, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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 + .unregister( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono unregisterAsync(String resourceProviderNamespace) { + return unregisterWithResponseAsync(resourceProviderNamespace).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response unregisterWithResponse(String resourceProviderNamespace, Context context) { + return unregisterWithResponseAsync(resourceProviderNamespace, context).block(); + } + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInner unregister(String resourceProviderNamespace) { + return unregisterWithResponse(resourceProviderNamespace, Context.NONE).getValue(); + } + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> registerAtManagementGroupScopeWithResponseAsync( + String resourceProviderNamespace, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .registerAtManagementGroupScope( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + groupId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> registerAtManagementGroupScopeWithResponseAsync( + String resourceProviderNamespace, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .registerAtManagementGroupScope( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + groupId, + accept, + context); + } + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 registerAtManagementGroupScopeAsync(String resourceProviderNamespace, String groupId) { + return registerAtManagementGroupScopeWithResponseAsync(resourceProviderNamespace, groupId) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response registerAtManagementGroupScopeWithResponse( + String resourceProviderNamespace, String groupId, Context context) { + return registerAtManagementGroupScopeWithResponseAsync(resourceProviderNamespace, groupId, context).block(); + } + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 registerAtManagementGroupScope(String resourceProviderNamespace, String groupId) { + registerAtManagementGroupScopeWithResponse(resourceProviderNamespace, groupId, Context.NONE); + } + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider permissions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> providerPermissionsWithResponseAsync( + String resourceProviderNamespace) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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 + .providerPermissions( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource 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 the provider permissions along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> providerPermissionsWithResponseAsync( + String resourceProviderNamespace, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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 + .providerPermissions( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider permissions on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono providerPermissionsAsync(String resourceProviderNamespace) { + return providerPermissionsWithResponseAsync(resourceProviderNamespace) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource 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 the provider permissions along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response providerPermissionsWithResponse( + String resourceProviderNamespace, Context context) { + return providerPermissionsWithResponseAsync(resourceProviderNamespace, context).block(); + } + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider permissions. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderPermissionListResultInner providerPermissions(String resourceProviderNamespace) { + return providerPermissionsWithResponse(resourceProviderNamespace, Context.NONE).getValue(); + } + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param properties The third party consent for S2S. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> registerWithResponseAsync( + String resourceProviderNamespace, ProviderRegistrationRequest properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .register( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param properties The third party consent for S2S. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> registerWithResponseAsync( + String resourceProviderNamespace, ProviderRegistrationRequest properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (properties != null) { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .register( + this.client.getEndpoint(), + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + properties, + accept, + context); + } + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono registerAsync(String resourceProviderNamespace) { + final ProviderRegistrationRequest properties = null; + return registerWithResponseAsync(resourceProviderNamespace, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param properties The third party consent for S2S. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response registerWithResponse( + String resourceProviderNamespace, ProviderRegistrationRequest properties, Context context) { + return registerWithResponseAsync(resourceProviderNamespace, properties, context).block(); + } + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInner register(String resourceProviderNamespace) { + final ProviderRegistrationRequest properties = null; + return registerWithResponse(resourceProviderNamespace, properties, Context.NONE).getValue(); + } + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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(), + expand, + 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())); + } + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String expand, 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(), + expand, + 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)); + } + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand) { + return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all resource providers for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String expand = null; + return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String expand, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(expand, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all resource providers for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String expand = null; + return new PagedIterable<>(listAsync(expand)); + } + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String expand, Context context) { + return new PagedIterable<>(listAsync(expand, context)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync(String expand) { + 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 + .listAtTenantScope( + this.client.getEndpoint(), expand, 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())); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeSinglePageAsync(String expand, 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 + .listAtTenantScope(this.client.getEndpoint(), expand, this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String expand) { + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(expand), nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all resource providers for the tenant. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync() { + final String expand = null; + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(expand), nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAtTenantScopeAsync(String expand, Context context) { + return new PagedFlux<>( + () -> listAtTenantScopeSinglePageAsync(expand, context), + nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all resource providers for the tenant. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope() { + final String expand = null; + return new PagedIterable<>(listAtTenantScopeAsync(expand)); + } + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAtTenantScope(String expand, Context context) { + return new PagedIterable<>(listAtTenantScopeAsync(expand, context)); + } + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceProviderNamespace, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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 + .get( + this.client.getEndpoint(), + expand, + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceProviderNamespace, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required 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 + .get( + this.client.getEndpoint(), + expand, + resourceProviderNamespace, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceProviderNamespace) { + final String expand = null; + return getWithResponseAsync(resourceProviderNamespace, expand).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceProviderNamespace, String expand, Context context) { + return getWithResponseAsync(resourceProviderNamespace, expand, context).block(); + } + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInner get(String resourceProviderNamespace) { + final String expand = null; + return getWithResponse(resourceProviderNamespace, expand, Context.NONE).getValue(); + } + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtTenantScopeWithResponseAsync( + String resourceProviderNamespace, String expand) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAtTenantScope( + this.client.getEndpoint(), + expand, + resourceProviderNamespace, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtTenantScopeWithResponseAsync( + String resourceProviderNamespace, String expand, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAtTenantScope( + this.client.getEndpoint(), + expand, + resourceProviderNamespace, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtTenantScopeAsync(String resourceProviderNamespace) { + final String expand = null; + return getAtTenantScopeWithResponseAsync(resourceProviderNamespace, expand) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtTenantScopeWithResponse( + String resourceProviderNamespace, String expand, Context context) { + return getAtTenantScopeWithResponseAsync(resourceProviderNamespace, expand, context).block(); + } + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProviderInner getAtTenantScope(String resourceProviderNamespace) { + final String expand = null; + return getAtTenantScopeWithResponse(resourceProviderNamespace, expand, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource providers 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource providers 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeNextSinglePageAsync(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.listAtTenantScopeNext(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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource providers along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAtTenantScopeNextSinglePageAsync(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 + .listAtTenantScopeNext(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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersImpl.java new file mode 100644 index 0000000000000..13d9a9666c1b6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ProvidersImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.ProvidersClient; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderPermissionListResultInner; +import com.azure.resourcemanager.resources.generated.models.Provider; +import com.azure.resourcemanager.resources.generated.models.ProviderPermissionListResult; +import com.azure.resourcemanager.resources.generated.models.ProviderRegistrationRequest; +import com.azure.resourcemanager.resources.generated.models.Providers; + +public final class ProvidersImpl implements Providers { + private static final ClientLogger LOGGER = new ClientLogger(ProvidersImpl.class); + + private final ProvidersClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public ProvidersImpl( + ProvidersClient innerClient, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response unregisterWithResponse(String resourceProviderNamespace, Context context) { + Response inner = this.serviceClient().unregisterWithResponse(resourceProviderNamespace, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Provider unregister(String resourceProviderNamespace) { + ProviderInner inner = this.serviceClient().unregister(resourceProviderNamespace); + if (inner != null) { + return new ProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response registerAtManagementGroupScopeWithResponse( + String resourceProviderNamespace, String groupId, Context context) { + return this + .serviceClient() + .registerAtManagementGroupScopeWithResponse(resourceProviderNamespace, groupId, context); + } + + public void registerAtManagementGroupScope(String resourceProviderNamespace, String groupId) { + this.serviceClient().registerAtManagementGroupScope(resourceProviderNamespace, groupId); + } + + public Response providerPermissionsWithResponse( + String resourceProviderNamespace, Context context) { + Response inner = + this.serviceClient().providerPermissionsWithResponse(resourceProviderNamespace, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderPermissionListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ProviderPermissionListResult providerPermissions(String resourceProviderNamespace) { + ProviderPermissionListResultInner inner = this.serviceClient().providerPermissions(resourceProviderNamespace); + if (inner != null) { + return new ProviderPermissionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response registerWithResponse( + String resourceProviderNamespace, ProviderRegistrationRequest properties, Context context) { + Response inner = + this.serviceClient().registerWithResponse(resourceProviderNamespace, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Provider register(String resourceProviderNamespace) { + ProviderInner inner = this.serviceClient().register(resourceProviderNamespace); + if (inner != null) { + return new ProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ProviderImpl(inner1, this.manager())); + } + + public PagedIterable list(String expand, Context context) { + PagedIterable inner = this.serviceClient().list(expand, context); + return Utils.mapPage(inner, inner1 -> new ProviderImpl(inner1, this.manager())); + } + + public PagedIterable listAtTenantScope() { + PagedIterable inner = this.serviceClient().listAtTenantScope(); + return Utils.mapPage(inner, inner1 -> new ProviderImpl(inner1, this.manager())); + } + + public PagedIterable listAtTenantScope(String expand, Context context) { + PagedIterable inner = this.serviceClient().listAtTenantScope(expand, context); + return Utils.mapPage(inner, inner1 -> new ProviderImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceProviderNamespace, String expand, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceProviderNamespace, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Provider get(String resourceProviderNamespace) { + ProviderInner inner = this.serviceClient().get(resourceProviderNamespace); + if (inner != null) { + return new ProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAtTenantScopeWithResponse( + String resourceProviderNamespace, String expand, Context context) { + Response inner = + this.serviceClient().getAtTenantScopeWithResponse(resourceProviderNamespace, expand, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ProviderImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Provider getAtTenantScope(String resourceProviderNamespace) { + ProviderInner inner = this.serviceClient().getAtTenantScope(resourceProviderNamespace); + if (inner != null) { + return new ProviderImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupExportResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupExportResultImpl.java new file mode 100644 index 0000000000000..b80ee65278b7b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupExportResultImpl.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.resources.generated.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupExportResultInner; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupExportResult; + +public final class ResourceGroupExportResultImpl implements ResourceGroupExportResult { + private ResourceGroupExportResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + ResourceGroupExportResultImpl( + ResourceGroupExportResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Object template() { + return this.innerModel().template(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public ResourceGroupExportResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupImpl.java new file mode 100644 index 0000000000000..5654a9b6a73e5 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupImpl.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner; +import com.azure.resourcemanager.resources.generated.models.ExportTemplateRequest; +import com.azure.resourcemanager.resources.generated.models.ResourceGroup; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupExportResult; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupPatchable; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupProperties; +import java.util.Collections; +import java.util.Map; + +public final class ResourceGroupImpl implements ResourceGroup, ResourceGroup.Definition, ResourceGroup.Update { + private ResourceGroupInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager 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 ResourceGroupProperties properties() { + return this.innerModel().properties(); + } + + public String managedBy() { + return this.innerModel().managedBy(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ResourceGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private ResourceGroupPatchable updateParameters; + + public ResourceGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getResourceGroups() + .createOrUpdateWithResponse(resourceGroupName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ResourceGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getResourceGroups() + .createOrUpdateWithResponse(resourceGroupName, this.innerModel(), context) + .getValue(); + return this; + } + + ResourceGroupImpl(String name, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = new ResourceGroupInner(); + this.serviceManager = serviceManager; + this.resourceGroupName = name; + } + + public ResourceGroupImpl update() { + this.updateParameters = new ResourceGroupPatchable(); + return this; + } + + public ResourceGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getResourceGroups() + .updateWithResponse(resourceGroupName, updateParameters, Context.NONE) + .getValue(); + return this; + } + + public ResourceGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getResourceGroups() + .updateWithResponse(resourceGroupName, updateParameters, context) + .getValue(); + return this; + } + + ResourceGroupImpl( + ResourceGroupInner innerObject, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + } + + public ResourceGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getResourceGroups() + .getWithResponse(resourceGroupName, Context.NONE) + .getValue(); + return this; + } + + public ResourceGroup refresh(Context context) { + this.innerObject = + serviceManager.serviceClient().getResourceGroups().getWithResponse(resourceGroupName, context).getValue(); + return this; + } + + public ResourceGroupExportResult exportTemplate(ExportTemplateRequest parameters) { + return serviceManager.resourceGroups().exportTemplate(resourceGroupName, parameters); + } + + public ResourceGroupExportResult exportTemplate(ExportTemplateRequest parameters, Context context) { + return serviceManager.resourceGroups().exportTemplate(resourceGroupName, parameters, context); + } + + public ResourceGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ResourceGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ResourceGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ResourceGroupImpl withProperties(ResourceGroupProperties properties) { + if (isInCreateMode()) { + this.innerModel().withProperties(properties); + return this; + } else { + this.updateParameters.withProperties(properties); + return this; + } + } + + public ResourceGroupImpl withManagedBy(String managedBy) { + if (isInCreateMode()) { + this.innerModel().withManagedBy(managedBy); + return this; + } else { + this.updateParameters.withManagedBy(managedBy); + return this; + } + } + + public ResourceGroupImpl withName(String name) { + this.updateParameters.withName(name); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsClientImpl.java new file mode 100644 index 0000000000000..0d7eca181579b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsClientImpl.java @@ -0,0 +1,1544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.Head; +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.resources.generated.fluent.ResourceGroupsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupExportResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner; +import com.azure.resourcemanager.resources.generated.models.ExportTemplateRequest; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupListResult; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupPatchable; +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 ResourceGroupsClient. */ +public final class ResourceGroupsClientImpl implements ResourceGroupsClient { + /** The proxy service used to perform REST calls. */ + private final ResourceGroupsService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of ResourceGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceGroupsClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy.create(ResourceGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientResourceGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface ResourceGroupsService { + @Headers({"Content-Type: application/json"}) + @Head("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistence( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ResourceGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("forceDeletionTypes") String forceDeletionTypes, + @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}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ResourceGroupPatchable parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> exportTemplate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ExportTemplateRequest parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourcegroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .checkExistence( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync(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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .checkExistence( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAsync(String resourceGroupName) { + return checkExistenceWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceWithResponse(String resourceGroupName, Context context) { + return checkExistenceWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistence(String resourceGroupName) { + return checkExistenceWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, ResourceGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, ResourceGroupInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, ResourceGroupInner parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, parameters, context).block(); + } + + /** + * Creates or updates a resource group. + * + * @param resourceGroupName The name of the resource group to create or update. Can include alphanumeric, + * underscore, parentheses, hyphen, period (except at end), and Unicode characters that match the allowed + * characters. + * @param parameters Parameters supplied to the create or update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters) { + return createOrUpdateWithResponse(resourceGroupName, parameters, Context.NONE).getValue(); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 forceDeletionTypes) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + forceDeletionTypes, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 forceDeletionTypes, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + forceDeletionTypes, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 forceDeletionTypes) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, forceDeletionTypes); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName) { + final String forceDeletionTypes = null; + Mono>> mono = deleteWithResponseAsync(resourceGroupName, forceDeletionTypes); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 forceDeletionTypes, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, forceDeletionTypes, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName) { + final String forceDeletionTypes = null; + return this.beginDeleteAsync(resourceGroupName, forceDeletionTypes).getSyncPoller(); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 forceDeletionTypes, Context context) { + return this.beginDeleteAsync(resourceGroupName, forceDeletionTypes, context).getSyncPoller(); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 forceDeletionTypes) { + return beginDeleteAsync(resourceGroupName, forceDeletionTypes) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName) { + final String forceDeletionTypes = null; + return beginDeleteAsync(resourceGroupName, forceDeletionTypes) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 forceDeletionTypes, Context context) { + return beginDeleteAsync(resourceGroupName, forceDeletionTypes, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName) { + final String forceDeletionTypes = null; + deleteAsync(resourceGroupName, forceDeletionTypes).block(); + } + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 forceDeletionTypes, Context context) { + deleteAsync(resourceGroupName, forceDeletionTypes, context).block(); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(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 (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName) { + return getWithResponseAsync(resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, context).block(); + } + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupInner get(String resourceGroupName) { + return getWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, ResourceGroupPatchable parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, ResourceGroupPatchable parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, ResourceGroupPatchable parameters) { + return updateWithResponseAsync(resourceGroupName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, ResourceGroupPatchable parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, parameters, context).block(); + } + + /** + * Updates a resource group. + * + *

Resource groups can be updated through a simple PATCH operation to a group address. The format of the request + * is the same as that for creating a resource group. If a field is unspecified, the current value is retained. + * + * @param resourceGroupName The name of the resource group to update. The name is case insensitive. + * @param parameters Parameters supplied to update a resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupInner update(String resourceGroupName, ResourceGroupPatchable parameters) { + return updateWithResponse(resourceGroupName, parameters, Context.NONE).getValue(); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportTemplateWithResponseAsync( + String resourceGroupName, ExportTemplateRequest parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .exportTemplate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportTemplateWithResponseAsync( + String resourceGroupName, ExportTemplateRequest parameters, 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 (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .exportTemplate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resource group export result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ResourceGroupExportResultInner> + beginExportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters) { + Mono>> mono = exportTemplateWithResponseAsync(resourceGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ResourceGroupExportResultInner.class, + ResourceGroupExportResultInner.class, + this.client.getContext()); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resource group export result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ResourceGroupExportResultInner> + beginExportTemplateAsync(String resourceGroupName, ExportTemplateRequest parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = exportTemplateWithResponseAsync(resourceGroupName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ResourceGroupExportResultInner.class, + ResourceGroupExportResultInner.class, + context); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource group export result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( + String resourceGroupName, ExportTemplateRequest parameters) { + return this.beginExportTemplateAsync(resourceGroupName, parameters).getSyncPoller(); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource group export result. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ResourceGroupExportResultInner> beginExportTemplate( + String resourceGroupName, ExportTemplateRequest parameters, Context context) { + return this.beginExportTemplateAsync(resourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAsync( + String resourceGroupName, ExportTemplateRequest parameters) { + return beginExportTemplateAsync(resourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportTemplateAsync( + String resourceGroupName, ExportTemplateRequest parameters, Context context) { + return beginExportTemplateAsync(resourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequest parameters) { + return exportTemplateAsync(resourceGroupName, parameters).block(); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceGroupExportResultInner exportTemplate( + String resourceGroupName, ExportTemplateRequest parameters, Context context) { + return exportTemplateAsync(resourceGroupName, parameters, context).block(); + } + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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(), + filter, + top, + 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())); + } + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top, 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(), + filter, + top, + 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)); + } + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the resource groups for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter, top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all the resource groups for a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource groups 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource groups 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsImpl.java new file mode 100644 index 0000000000000..16ca4f3661cde --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceGroupsImpl.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.resources.generated.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.resources.generated.fluent.ResourceGroupsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupExportResultInner; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner; +import com.azure.resourcemanager.resources.generated.models.ExportTemplateRequest; +import com.azure.resourcemanager.resources.generated.models.ResourceGroup; +import com.azure.resourcemanager.resources.generated.models.ResourceGroupExportResult; +import com.azure.resourcemanager.resources.generated.models.ResourceGroups; + +public final class ResourceGroupsImpl implements ResourceGroups { + private static final ClientLogger LOGGER = new ClientLogger(ResourceGroupsImpl.class); + + private final ResourceGroupsClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public ResourceGroupsImpl( + ResourceGroupsClient innerClient, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkExistenceWithResponse(String resourceGroupName, Context context) { + return this.serviceClient().checkExistenceWithResponse(resourceGroupName, context); + } + + public boolean checkExistence(String resourceGroupName) { + return this.serviceClient().checkExistence(resourceGroupName); + } + + public void deleteByResourceGroup(String resourceGroupName) { + this.serviceClient().delete(resourceGroupName); + } + + public void delete(String resourceGroupName, String forceDeletionTypes, Context context) { + this.serviceClient().delete(resourceGroupName, forceDeletionTypes, context); + } + + public Response getWithResponse(String resourceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ResourceGroup get(String resourceGroupName) { + ResourceGroupInner inner = this.serviceClient().get(resourceGroupName); + if (inner != null) { + return new ResourceGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public ResourceGroupExportResult exportTemplate(String resourceGroupName, ExportTemplateRequest parameters) { + ResourceGroupExportResultInner inner = this.serviceClient().exportTemplate(resourceGroupName, parameters); + if (inner != null) { + return new ResourceGroupExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ResourceGroupExportResult exportTemplate( + String resourceGroupName, ExportTemplateRequest parameters, Context context) { + ResourceGroupExportResultInner inner = + this.serviceClient().exportTemplate(resourceGroupName, parameters, context); + if (inner != null) { + return new ResourceGroupExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceGroupImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, context); + return Utils.mapPage(inner, inner1 -> new ResourceGroupImpl(inner1, this.manager())); + } + + public ResourceGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + return this.getWithResponse(resourceGroupName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + return this.getWithResponse(resourceGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + String localForceDeletionTypes = null; + this.delete(resourceGroupName, localForceDeletionTypes, Context.NONE); + } + + public void deleteByIdWithResponse(String id, String forceDeletionTypes, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); + } + this.delete(resourceGroupName, forceDeletionTypes, context); + } + + private ResourceGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } + + public ResourceGroupImpl define(String name) { + return new ResourceGroupImpl(name, this.manager()); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientBuilder.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientBuilder.java new file mode 100644 index 0000000000000..bc18bd3e0b7d1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientBuilder.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.resources.generated.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 ResourceManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ResourceManagementClientImpl.class}) +public final class ResourceManagementClientBuilder { + /* + * The Microsoft Azure subscription ID. + */ + private String subscriptionId; + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the ResourceManagementClientBuilder. + */ + public ResourceManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ResourceManagementClientBuilder. + */ + public ResourceManagementClientBuilder 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 ResourceManagementClientBuilder. + */ + public ResourceManagementClientBuilder 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 ResourceManagementClientBuilder. + */ + public ResourceManagementClientBuilder 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 ResourceManagementClientBuilder. + */ + public ResourceManagementClientBuilder 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 ResourceManagementClientBuilder. + */ + public ResourceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ResourceManagementClientImpl with the provided parameters. + * + * @return an instance of ResourceManagementClientImpl. + */ + public ResourceManagementClientImpl 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(); + ResourceManagementClientImpl client = + new ResourceManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientImpl.java new file mode 100644 index 0000000000000..24c73df955531 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourceManagementClientImpl.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.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.resources.generated.fluent.DeploymentOperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.DeploymentsClient; +import com.azure.resourcemanager.resources.generated.fluent.OperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.ProviderResourceTypesClient; +import com.azure.resourcemanager.resources.generated.fluent.ProvidersClient; +import com.azure.resourcemanager.resources.generated.fluent.ResourceGroupsClient; +import com.azure.resourcemanager.resources.generated.fluent.ResourceManagementClient; +import com.azure.resourcemanager.resources.generated.fluent.ResourcesClient; +import com.azure.resourcemanager.resources.generated.fluent.TagOperationsClient; +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 ResourceManagementClientImpl type. */ +@ServiceClient(builder = ResourceManagementClientBuilder.class) +public final class ResourceManagementClientImpl implements ResourceManagementClient { + /** The Microsoft Azure subscription ID. */ + private final String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @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 DeploymentsClient object to access its operations. */ + private final DeploymentsClient deployments; + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + public DeploymentsClient getDeployments() { + return this.deployments; + } + + /** The ProvidersClient object to access its operations. */ + private final ProvidersClient providers; + + /** + * Gets the ProvidersClient object to access its operations. + * + * @return the ProvidersClient object. + */ + public ProvidersClient getProviders() { + return this.providers; + } + + /** The ProviderResourceTypesClient object to access its operations. */ + private final ProviderResourceTypesClient providerResourceTypes; + + /** + * Gets the ProviderResourceTypesClient object to access its operations. + * + * @return the ProviderResourceTypesClient object. + */ + public ProviderResourceTypesClient getProviderResourceTypes() { + return this.providerResourceTypes; + } + + /** The ResourcesClient object to access its operations. */ + private final ResourcesClient resources; + + /** + * Gets the ResourcesClient object to access its operations. + * + * @return the ResourcesClient object. + */ + public ResourcesClient getResources() { + return this.resources; + } + + /** The ResourceGroupsClient object to access its operations. */ + private final ResourceGroupsClient resourceGroups; + + /** + * Gets the ResourceGroupsClient object to access its operations. + * + * @return the ResourceGroupsClient object. + */ + public ResourceGroupsClient getResourceGroups() { + return this.resourceGroups; + } + + /** The TagOperationsClient object to access its operations. */ + private final TagOperationsClient tagOperations; + + /** + * Gets the TagOperationsClient object to access its operations. + * + * @return the TagOperationsClient object. + */ + public TagOperationsClient getTagOperations() { + return this.tagOperations; + } + + /** The DeploymentOperationsClient object to access its operations. */ + private final DeploymentOperationsClient deploymentOperations; + + /** + * Gets the DeploymentOperationsClient object to access its operations. + * + * @return the DeploymentOperationsClient object. + */ + public DeploymentOperationsClient getDeploymentOperations() { + return this.deploymentOperations; + } + + /** + * Initializes an instance of ResourceManagementClient 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 Microsoft Azure subscription ID. + * @param endpoint server parameter. + */ + ResourceManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-09-01"; + this.operations = new OperationsClientImpl(this); + this.deployments = new DeploymentsClientImpl(this); + this.providers = new ProvidersClientImpl(this); + this.providerResourceTypes = new ProviderResourceTypesClientImpl(this); + this.resources = new ResourcesClientImpl(this); + this.resourceGroups = new ResourceGroupsClientImpl(this); + this.tagOperations = new TagOperationsClientImpl(this); + this.deploymentOperations = new DeploymentOperationsClientImpl(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(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(ResourceManagementClientImpl.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesClientImpl.java new file mode 100644 index 0000000000000..a8c10ef7108ee --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesClientImpl.java @@ -0,0 +1,4493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.Head; +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.resources.generated.fluent.ResourcesClient; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceExpandedInner; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner; +import com.azure.resourcemanager.resources.generated.models.ResourceListResult; +import com.azure.resourcemanager.resources.generated.models.ResourcesMoveInfo; +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 ResourcesClient. */ +public final class ResourcesClientImpl implements ResourcesClient { + /** The proxy service used to perform REST calls. */ + private final ResourcesService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of ResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourcesClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy.create(ResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface ResourcesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> moveResources( + @HostParam("$host") String endpoint, + @PathParam("sourceResourceGroupName") String sourceResourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ResourcesMoveInfo parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/validateMoveResources") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateMoveResources( + @HostParam("$host") String endpoint, + @PathParam("sourceResourceGroupName") String sourceResourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ResourcesMoveInfo parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, + @QueryParam("$expand") String expand, + @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistence( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GenericResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") GenericResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceProviderNamespace") String resourceProviderNamespace, + @PathParam(value = "parentResourcePath", encoded = true) String parentResourcePath, + @PathParam(value = "resourceType", encoded = true) String resourceType, + @PathParam("resourceName") String resourceName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Head("/{resourceId}") + @ExpectedResponses({204, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkExistenceById( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{resourceId}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteById( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/{resourceId}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateById( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GenericResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{resourceId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateById( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") GenericResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{resourceId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getById( + @HostParam("$host") String endpoint, + @PathParam(value = "resourceId", encoded = true) String resourceId, + @QueryParam("api-version") String apiVersion, + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, String expand, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + filter, + expand, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, String expand, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required 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 + .listByResourceGroup( + this.client.getEndpoint(), + resourceGroupName, + filter, + expand, + top, + 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)); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, String expand, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, String expand, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, expand, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top)); + } + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String expand, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, expand, top, context)); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> moveResourcesWithResponseAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sourceResourceGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .moveResources( + this.client.getEndpoint(), + sourceResourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> moveResourcesWithResponseAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sourceResourceGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .moveResources( + this.client.getEndpoint(), + sourceResourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginMoveResourcesAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters) { + Mono>> mono = moveResourcesWithResponseAsync(sourceResourceGroupName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginMoveResourcesAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + moveResourcesWithResponseAsync(sourceResourceGroupName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters) { + return this.beginMoveResourcesAsync(sourceResourceGroupName, parameters).getSyncPoller(); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + return this.beginMoveResourcesAsync(sourceResourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { + return beginMoveResourcesAsync(sourceResourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 moveResourcesAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + return beginMoveResourcesAsync(sourceResourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { + moveResourcesAsync(sourceResourceGroupName, parameters).block(); + } + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + moveResourcesAsync(sourceResourceGroupName, parameters, context).block(); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> validateMoveResourcesWithResponseAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sourceResourceGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateMoveResources( + this.client.getEndpoint(), + sourceResourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> validateMoveResourcesWithResponseAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sourceResourceGroupName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateMoveResources( + this.client.getEndpoint(), + sourceResourceGroupName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginValidateMoveResourcesAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters) { + Mono>> mono = + validateMoveResourcesWithResponseAsync(sourceResourceGroupName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginValidateMoveResourcesAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateMoveResourcesWithResponseAsync(sourceResourceGroupName, parameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginValidateMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters) { + return this.beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters).getSyncPoller(); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginValidateMoveResources( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + return this.beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters, context).getSyncPoller(); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validateMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters) { + return beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validateMoveResourcesAsync( + String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + return beginValidateMoveResourcesAsync(sourceResourceGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { + validateMoveResourcesAsync(sourceResourceGroupName, parameters).block(); + } + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + validateMoveResourcesAsync(sourceResourceGroupName, parameters, context).block(); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, String expand, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required 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(), + filter, + expand, + top, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, String expand, Integer top, 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(), + filter, + expand, + top, + 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)); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, String expand, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, expand, top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all the resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, expand, top), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String filter, String expand, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, expand, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final String expand = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, expand, top)); + } + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String filter, String expand, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, expand, top, context)); + } + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 + .checkExistence( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 + .checkExistence( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return checkExistenceWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + return checkExistenceWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context) + .block(); + } + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistence( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return checkExistenceWithResponse( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + Context.NONE) + .getValue(); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 + .delete( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return this + .beginDeleteAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion) + .getSyncPoller(); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + return this + .beginDeleteAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context) + .getSyncPoller(); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return beginDeleteAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + return beginDeleteAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + deleteAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion) + .block(); + } + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + deleteAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context) + .block(); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenericResourceInner.class, + GenericResourceInner.class, + this.client.getContext()); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters) + .getSyncPoller(); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context) + .getSyncPoller(); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + return createOrUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters) + .block(); + } + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context) + .block(); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginUpdateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenericResourceInner.class, + GenericResourceInner.class, + this.client.getContext()); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginUpdateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + return this + .beginUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters) + .getSyncPoller(); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + return this + .beginUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context) + .getSyncPoller(); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + return beginUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + return updateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters) + .block(); + } + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + return updateAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context) + .block(); + } + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceProviderNamespace == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter resourceProviderNamespace is required and cannot be null.")); + } + if (parentResourcePath == null) { + return Mono + .error(new IllegalArgumentException("Parameter parentResourcePath is required and cannot be null.")); + } + if (resourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required 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 + .get( + this.client.getEndpoint(), + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return getWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + return getWithResponseAsync( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context) + .block(); + } + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner get( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return getWithResponse( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + Context.NONE) + .getValue(); + } + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceByIdWithResponseAsync(String resourceId, String apiVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkExistenceByIdWithResponseAsync( + String resourceId, String apiVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkExistenceById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); + } + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkExistenceByIdAsync(String resourceId, String apiVersion) { + return checkExistenceByIdWithResponseAsync(resourceId, apiVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context) { + return checkExistenceByIdWithResponseAsync(resourceId, apiVersion, context).block(); + } + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkExistenceById(String resourceId, String apiVersion) { + return checkExistenceByIdWithResponse(resourceId, apiVersion, Context.NONE).getValue(); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteByIdWithResponseAsync(String resourceId, String apiVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteByIdWithResponseAsync( + String resourceId, String apiVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteByIdAsync(String resourceId, String apiVersion) { + Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteByIdAsync( + String resourceId, String apiVersion, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteByIdWithResponseAsync(resourceId, apiVersion, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteById(String resourceId, String apiVersion) { + return this.beginDeleteByIdAsync(resourceId, apiVersion).getSyncPoller(); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteById(String resourceId, String apiVersion, Context context) { + return this.beginDeleteByIdAsync(resourceId, apiVersion, context).getSyncPoller(); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteByIdAsync(String resourceId, String apiVersion) { + return beginDeleteByIdAsync(resourceId, apiVersion).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteByIdAsync(String resourceId, String apiVersion, Context context) { + return beginDeleteByIdAsync(resourceId, apiVersion, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteById(String resourceId, String apiVersion) { + deleteByIdAsync(resourceId, apiVersion).block(); + } + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteById(String resourceId, String apiVersion, Context context) { + deleteByIdAsync(resourceId, apiVersion, context).block(); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateByIdWithResponseAsync( + String resourceId, String apiVersion, GenericResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateById( + this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateByIdWithResponseAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters) { + Mono>> mono = createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenericResourceInner.class, + GenericResourceInner.class, + this.client.getContext()); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginCreateOrUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginCreateOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters) { + return this.beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginCreateOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + return this.beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters) { + return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + return beginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner createOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters) { + return createOrUpdateByIdAsync(resourceId, apiVersion, parameters).block(); + } + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner createOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + return createOrUpdateByIdAsync(resourceId, apiVersion, parameters, context).block(); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateByIdWithResponseAsync( + String resourceId, String apiVersion, GenericResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateByIdWithResponseAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.updateById(this.client.getEndpoint(), resourceId, apiVersion, parameters, accept, context); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters) { + Mono>> mono = updateByIdWithResponseAsync(resourceId, apiVersion, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GenericResourceInner.class, + GenericResourceInner.class, + this.client.getContext()); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GenericResourceInner> beginUpdateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateByIdWithResponseAsync(resourceId, apiVersion, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GenericResourceInner.class, GenericResourceInner.class, context); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters) { + return this.beginUpdateByIdAsync(resourceId, apiVersion, parameters).getSyncPoller(); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GenericResourceInner> beginUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + return this.beginUpdateByIdAsync(resourceId, apiVersion, parameters, context).getSyncPoller(); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters) { + return beginUpdateByIdAsync(resourceId, apiVersion, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateByIdAsync( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + return beginUpdateByIdAsync(resourceId, apiVersion, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner updateById(String resourceId, String apiVersion, GenericResourceInner parameters) { + return updateByIdAsync(resourceId, apiVersion, parameters).block(); + } + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner updateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + return updateByIdAsync(resourceId, apiVersion, parameters, context).block(); + } + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync(String resourceId, String apiVersion) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource by ID along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByIdWithResponseAsync( + String resourceId, String apiVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceId == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); + } + if (apiVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter apiVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getById(this.client.getEndpoint(), resourceId, apiVersion, accept, context); + } + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource by ID on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByIdAsync(String resourceId, String apiVersion) { + return getByIdWithResponseAsync(resourceId, apiVersion).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource by ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByIdWithResponse(String resourceId, String apiVersion, Context context) { + return getByIdWithResponseAsync(resourceId, apiVersion, context).block(); + } + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 resource by ID. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GenericResourceInner getById(String resourceId, String apiVersion) { + return getByIdWithResponse(resourceId, apiVersion, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource groups 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource groups 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)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource groups 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource groups 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesImpl.java new file mode 100644 index 0000000000000..04d22a53d2e4c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/ResourcesImpl.java @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.ResourcesClient; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceExpandedInner; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner; +import com.azure.resourcemanager.resources.generated.models.GenericResource; +import com.azure.resourcemanager.resources.generated.models.GenericResourceExpanded; +import com.azure.resourcemanager.resources.generated.models.Resources; +import com.azure.resourcemanager.resources.generated.models.ResourcesMoveInfo; + +public final class ResourcesImpl implements Resources { + private static final ClientLogger LOGGER = new ClientLogger(ResourcesImpl.class); + + private final ResourcesClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public ResourcesImpl( + ResourcesClient innerClient, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new GenericResourceExpandedImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String expand, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, expand, top, context); + return Utils.mapPage(inner, inner1 -> new GenericResourceExpandedImpl(inner1, this.manager())); + } + + public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { + this.serviceClient().moveResources(sourceResourceGroupName, parameters); + } + + public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + this.serviceClient().moveResources(sourceResourceGroupName, parameters, context); + } + + public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) { + this.serviceClient().validateMoveResources(sourceResourceGroupName, parameters); + } + + public void validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) { + this.serviceClient().validateMoveResources(sourceResourceGroupName, parameters, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new GenericResourceExpandedImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, String expand, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, expand, top, context); + return Utils.mapPage(inner, inner1 -> new GenericResourceExpandedImpl(inner1, this.manager())); + } + + public Response checkExistenceWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + return this + .serviceClient() + .checkExistenceWithResponse( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context); + } + + public boolean checkExistence( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + return this + .serviceClient() + .checkExistence( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion); + } + + public void delete( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + this + .serviceClient() + .delete( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion); + } + + public void delete( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context); + } + + public GenericResource createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + GenericResourceInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenericResource createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + GenericResourceInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenericResource update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters) { + GenericResourceInner inner = + this + .serviceClient() + .update( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenericResource update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context) { + GenericResourceInner inner = + this + .serviceClient() + .update( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + parameters, + context); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GenericResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GenericResource get( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion) { + GenericResourceInner inner = + this + .serviceClient() + .get( + resourceGroupName, + resourceProviderNamespace, + parentResourcePath, + resourceType, + resourceName, + apiVersion); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context) { + return this.serviceClient().checkExistenceByIdWithResponse(resourceId, apiVersion, context); + } + + public boolean checkExistenceById(String resourceId, String apiVersion) { + return this.serviceClient().checkExistenceById(resourceId, apiVersion); + } + + public void deleteById(String resourceId, String apiVersion) { + this.serviceClient().deleteById(resourceId, apiVersion); + } + + public void deleteById(String resourceId, String apiVersion, Context context) { + this.serviceClient().deleteById(resourceId, apiVersion, context); + } + + public GenericResource createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters) { + GenericResourceInner inner = this.serviceClient().createOrUpdateById(resourceId, apiVersion, parameters); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenericResource createOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + GenericResourceInner inner = + this.serviceClient().createOrUpdateById(resourceId, apiVersion, parameters, context); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenericResource updateById(String resourceId, String apiVersion, GenericResourceInner parameters) { + GenericResourceInner inner = this.serviceClient().updateById(resourceId, apiVersion, parameters); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public GenericResource updateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context) { + GenericResourceInner inner = this.serviceClient().updateById(resourceId, apiVersion, parameters, context); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByIdWithResponse(String resourceId, String apiVersion, Context context) { + Response inner = + this.serviceClient().getByIdWithResponse(resourceId, apiVersion, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GenericResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GenericResource getById(String resourceId, String apiVersion) { + GenericResourceInner inner = this.serviceClient().getById(resourceId, apiVersion); + if (inner != null) { + return new GenericResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagDetailsImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagDetailsImpl.java new file mode 100644 index 0000000000000..837a8a12d37c1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagDetailsImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagDetailsInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner; +import com.azure.resourcemanager.resources.generated.models.TagCount; +import com.azure.resourcemanager.resources.generated.models.TagDetails; +import com.azure.resourcemanager.resources.generated.models.TagValue; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class TagDetailsImpl implements TagDetails { + private TagDetailsInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + TagDetailsImpl( + TagDetailsInner innerObject, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String tagName() { + return this.innerModel().tagName(); + } + + public TagCount count() { + return this.innerModel().count(); + } + + public List values() { + List inner = this.innerModel().values(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new TagValueImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public TagDetailsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsClientImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsClientImpl.java new file mode 100644 index 0000000000000..5d724d4240f7b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsClientImpl.java @@ -0,0 +1,1812 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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.resources.generated.fluent.TagOperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.TagDetailsInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.generated.models.TagsListResult; +import com.azure.resourcemanager.resources.generated.models.TagsPatchResource; +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 TagOperationsClient. */ +public final class TagOperationsClientImpl implements TagOperationsClient { + /** The proxy service used to perform REST calls. */ + private final TagOperationsService service; + + /** The service client containing this operation class. */ + private final ResourceManagementClientImpl client; + + /** + * Initializes an instance of TagOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TagOperationsClientImpl(ResourceManagementClientImpl client) { + this.service = + RestProxy.create(TagOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ResourceManagementClientTagOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ResourceManagementCl") + public interface TagOperationsService { + @Headers({"Content-Type: application/json"}) + @Delete("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteValue( + @HostParam("$host") String endpoint, + @PathParam("tagName") String tagName, + @PathParam("tagValue") String tagValue, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateValue( + @HostParam("$host") String endpoint, + @PathParam("tagName") String tagName, + @PathParam("tagValue") String tagValue, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put("/subscriptions/{subscriptionId}/tagNames/{tagName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("tagName") String tagName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/subscriptions/{subscriptionId}/tagNames/{tagName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("tagName") String tagName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/tagNames") + @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"}) + @Put("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdateAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") TagsPatchResource parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete("/{scope}/providers/Microsoft.Resources/tags/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteAtScope( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @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); + } + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> deleteValueWithResponseAsync(String tagName, String tagValue) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required 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 + .deleteValue( + this.client.getEndpoint(), + tagName, + tagValue, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> deleteValueWithResponseAsync(String tagName, String tagValue, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required 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 + .deleteValue( + this.client.getEndpoint(), + tagName, + tagValue, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteValueAsync(String tagName, String tagValue) { + return deleteValueWithResponseAsync(tagName, tagValue).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 deleteValueWithResponse(String tagName, String tagValue, Context context) { + return deleteValueWithResponseAsync(tagName, tagValue, context).block(); + } + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteValue(String tagName, String tagValue) { + deleteValueWithResponse(tagName, tagValue, Context.NONE); + } + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateValueWithResponseAsync(String tagName, String tagValue) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required 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 + .createOrUpdateValue( + this.client.getEndpoint(), + tagName, + tagValue, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateValueWithResponseAsync( + String tagName, String tagValue, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required and cannot be null.")); + } + if (tagValue == null) { + return Mono.error(new IllegalArgumentException("Parameter tagValue is required 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 + .createOrUpdateValue( + this.client.getEndpoint(), + tagName, + tagValue, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateValueAsync(String tagName, String tagValue) { + return createOrUpdateValueWithResponseAsync(tagName, tagValue).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context) { + return createOrUpdateValueWithResponseAsync(tagName, tagValue, context).block(); + } + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagValueInner createOrUpdateValue(String tagName, String tagValue) { + return createOrUpdateValueWithResponse(tagName, tagValue, Context.NONE).getValue(); + } + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String tagName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required 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 + .createOrUpdate( + this.client.getEndpoint(), + tagName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String tagName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required 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 + .createOrUpdate( + this.client.getEndpoint(), + tagName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String tagName) { + return createOrUpdateWithResponseAsync(tagName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String tagName, Context context) { + return createOrUpdateWithResponseAsync(tagName, context).block(); + } + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagDetailsInner createOrUpdate(String tagName) { + return createOrUpdateWithResponse(tagName, Context.NONE).getValue(); + } + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 tagName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required 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 + .delete( + this.client.getEndpoint(), + tagName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 tagName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (tagName == null) { + return Mono.error(new IllegalArgumentException("Parameter tagName is required 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 + .delete( + this.client.getEndpoint(), + tagName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context); + } + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 tagName) { + return deleteWithResponseAsync(tagName).flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 tagName, Context context) { + return deleteWithResponseAsync(tagName, context).block(); + } + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 tagName) { + deleteWithResponse(tagName, Context.NONE); + } + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags 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())); + } + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags 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)); + } + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtScopeWithResponseAsync( + String scope, TagsResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateAtScope( + this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateAtScopeWithResponseAsync( + String scope, TagsResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateAtScope( + this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync( + String scope, TagsResourceInner parameters) { + Mono>> mono = createOrUpdateAtScopeWithResponseAsync(scope, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TagsResourceInner.class, + TagsResourceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagsResourceInner> beginCreateOrUpdateAtScopeAsync( + String scope, TagsResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createOrUpdateAtScopeWithResponseAsync(scope, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TagsResourceInner.class, TagsResourceInner.class, context); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope( + String scope, TagsResourceInner parameters) { + return this.beginCreateOrUpdateAtScopeAsync(scope, parameters).getSyncPoller(); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginCreateOrUpdateAtScope( + String scope, TagsResourceInner parameters, Context context) { + return this.beginCreateOrUpdateAtScopeAsync(scope, parameters, context).getSyncPoller(); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtScopeAsync(String scope, TagsResourceInner parameters) { + return beginCreateOrUpdateAtScopeAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAtScopeAsync( + String scope, TagsResourceInner parameters, Context context) { + return beginCreateOrUpdateAtScopeAsync(scope, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters) { + return createOrUpdateAtScopeAsync(scope, parameters).block(); + } + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context) { + return createOrUpdateAtScopeAsync(scope, parameters, context).block(); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAtScopeWithResponseAsync( + String scope, TagsPatchResource parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateAtScope( + this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateAtScopeWithResponseAsync( + String scope, TagsPatchResource parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync( + String scope, TagsPatchResource parameters) { + Mono>> mono = updateAtScopeWithResponseAsync(scope, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TagsResourceInner.class, + TagsResourceInner.class, + this.client.getContext()); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TagsResourceInner> beginUpdateAtScopeAsync( + String scope, TagsPatchResource parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateAtScopeWithResponseAsync(scope, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), TagsResourceInner.class, TagsResourceInner.class, context); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginUpdateAtScope( + String scope, TagsPatchResource parameters) { + return this.beginUpdateAtScopeAsync(scope, parameters).getSyncPoller(); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TagsResourceInner> beginUpdateAtScope( + String scope, TagsPatchResource parameters, Context context) { + return this.beginUpdateAtScopeAsync(scope, parameters, context).getSyncPoller(); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAtScopeAsync(String scope, TagsPatchResource parameters) { + return beginUpdateAtScopeAsync(scope, parameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAtScopeAsync(String scope, TagsPatchResource parameters, Context context) { + return beginUpdateAtScopeAsync(scope, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters) { + return updateAtScopeAsync(scope, parameters).block(); + } + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters, Context context) { + return updateAtScopeAsync(scope, parameters, context).block(); + } + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtScopeWithResponseAsync(String scope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service.getAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAtScopeWithResponseAsync(String scope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAtScopeAsync(String scope) { + return getAtScopeWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAtScopeWithResponse(String scope, Context context) { + return getAtScopeWithResponseAsync(scope, context).block(); + } + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TagsResourceInner getAtScope(String scope) { + return getAtScopeWithResponse(scope, Context.NONE).getValue(); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtScopeWithResponseAsync(String scope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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>> deleteAtScopeWithResponseAsync(String scope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.deleteAtScope(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtScopeAsync(String scope) { + Mono>> mono = deleteAtScopeWithResponseAsync(scope); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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> beginDeleteAtScopeAsync(String scope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteAtScopeWithResponseAsync(scope, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtScope(String scope) { + return this.beginDeleteAtScopeAsync(scope).getSyncPoller(); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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> beginDeleteAtScope(String scope, Context context) { + return this.beginDeleteAtScopeAsync(scope, context).getSyncPoller(); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtScopeAsync(String scope) { + return beginDeleteAtScopeAsync(scope).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 deleteAtScopeAsync(String scope, Context context) { + return beginDeleteAtScopeAsync(scope, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtScope(String scope) { + deleteAtScopeAsync(scope).block(); + } + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 deleteAtScope(String scope, Context context) { + deleteAtScopeAsync(scope, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags 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 + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsImpl.java new file mode 100644 index 0000000000000..d12348cb16843 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagOperationsImpl.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.resources.generated.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.resources.generated.fluent.TagOperationsClient; +import com.azure.resourcemanager.resources.generated.fluent.models.TagDetailsInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner; +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.generated.models.TagDetails; +import com.azure.resourcemanager.resources.generated.models.TagOperations; +import com.azure.resourcemanager.resources.generated.models.TagValue; +import com.azure.resourcemanager.resources.generated.models.TagsPatchResource; +import com.azure.resourcemanager.resources.generated.models.TagsResource; + +public final class TagOperationsImpl implements TagOperations { + private static final ClientLogger LOGGER = new ClientLogger(TagOperationsImpl.class); + + private final TagOperationsClient innerClient; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + public TagOperationsImpl( + TagOperationsClient innerClient, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response deleteValueWithResponse(String tagName, String tagValue, Context context) { + return this.serviceClient().deleteValueWithResponse(tagName, tagValue, context); + } + + public void deleteValue(String tagName, String tagValue) { + this.serviceClient().deleteValue(tagName, tagValue); + } + + public Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context) { + Response inner = + this.serviceClient().createOrUpdateValueWithResponse(tagName, tagValue, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagValueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TagValue createOrUpdateValue(String tagName, String tagValue) { + TagValueInner inner = this.serviceClient().createOrUpdateValue(tagName, tagValue); + if (inner != null) { + return new TagValueImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String tagName, Context context) { + Response inner = this.serviceClient().createOrUpdateWithResponse(tagName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagDetailsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TagDetails createOrUpdate(String tagName) { + TagDetailsInner inner = this.serviceClient().createOrUpdate(tagName); + if (inner != null) { + return new TagDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String tagName, Context context) { + return this.serviceClient().deleteWithResponse(tagName, context); + } + + public void delete(String tagName) { + this.serviceClient().delete(tagName); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new TagDetailsImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new TagDetailsImpl(inner1, this.manager())); + } + + public TagsResource createOrUpdateAtScope(String scope, TagsResourceInner parameters) { + TagsResourceInner inner = this.serviceClient().createOrUpdateAtScope(scope, parameters); + if (inner != null) { + return new TagsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public TagsResource createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context) { + TagsResourceInner inner = this.serviceClient().createOrUpdateAtScope(scope, parameters, context); + if (inner != null) { + return new TagsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public TagsResource updateAtScope(String scope, TagsPatchResource parameters) { + TagsResourceInner inner = this.serviceClient().updateAtScope(scope, parameters); + if (inner != null) { + return new TagsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public TagsResource updateAtScope(String scope, TagsPatchResource parameters, Context context) { + TagsResourceInner inner = this.serviceClient().updateAtScope(scope, parameters, context); + if (inner != null) { + return new TagsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAtScopeWithResponse(String scope, Context context) { + Response inner = this.serviceClient().getAtScopeWithResponse(scope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TagsResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TagsResource getAtScope(String scope) { + TagsResourceInner inner = this.serviceClient().getAtScope(scope); + if (inner != null) { + return new TagsResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteAtScope(String scope) { + this.serviceClient().deleteAtScope(scope); + } + + public void deleteAtScope(String scope, Context context) { + this.serviceClient().deleteAtScope(scope, context); + } + + private TagOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagValueImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagValueImpl.java new file mode 100644 index 0000000000000..e2e6ceb6b6d5f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagValueImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner; +import com.azure.resourcemanager.resources.generated.models.TagCount; +import com.azure.resourcemanager.resources.generated.models.TagValue; + +public final class TagValueImpl implements TagValue { + private TagValueInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + TagValueImpl( + TagValueInner innerObject, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String tagValue() { + return this.innerModel().tagValue(); + } + + public TagCount count() { + return this.innerModel().count(); + } + + public TagValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagsResourceImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagsResourceImpl.java new file mode 100644 index 0000000000000..a9867e4e317b0 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TagsResourceImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.generated.models.Tags; +import com.azure.resourcemanager.resources.generated.models.TagsResource; + +public final class TagsResourceImpl implements TagsResource { + private TagsResourceInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + TagsResourceImpl( + TagsResourceInner innerObject, com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Tags properties() { + return this.innerModel().properties(); + } + + public TagsResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TemplateHashResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TemplateHashResultImpl.java new file mode 100644 index 0000000000000..4e3fe9bbac996 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/TemplateHashResultImpl.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.resources.generated.implementation; + +import com.azure.resourcemanager.resources.generated.fluent.models.TemplateHashResultInner; +import com.azure.resourcemanager.resources.generated.models.TemplateHashResult; + +public final class TemplateHashResultImpl implements TemplateHashResult { + private TemplateHashResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + TemplateHashResultImpl( + TemplateHashResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String minifiedTemplate() { + return this.innerModel().minifiedTemplate(); + } + + public String templateHash() { + return this.innerModel().templateHash(); + } + + public TemplateHashResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/Utils.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/Utils.java new file mode 100644 index 0000000000000..bef23cff96340 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/WhatIfOperationResultImpl.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/WhatIfOperationResultImpl.java new file mode 100644 index 0000000000000..d0832da2e7204 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/WhatIfOperationResultImpl.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.resources.generated.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.WhatIfOperationResultInner; +import com.azure.resourcemanager.resources.generated.models.WhatIfChange; +import com.azure.resourcemanager.resources.generated.models.WhatIfOperationResult; +import java.util.Collections; +import java.util.List; + +public final class WhatIfOperationResultImpl implements WhatIfOperationResult { + private WhatIfOperationResultInner innerObject; + + private final com.azure.resourcemanager.resources.generated.ResourceManager serviceManager; + + WhatIfOperationResultImpl( + WhatIfOperationResultInner innerObject, + com.azure.resourcemanager.resources.generated.ResourceManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String status() { + return this.innerModel().status(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public List changes() { + List inner = this.innerModel().changes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public WhatIfOperationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.resources.generated.ResourceManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/package-info.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/implementation/package-info.java new file mode 100644 index 0000000000000..310c775cade01 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/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 ResourceManagementClient. Provides operations for working with resources + * and resource groups. + */ +package com.azure.resourcemanager.resources.generated.implementation; diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Alias.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Alias.java new file mode 100644 index 0000000000000..d45758cf9876b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Alias.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The alias type. */ +@Fluent +public final class Alias { + /* + * The alias name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The paths for an alias. + */ + @JsonProperty(value = "paths") + private List paths; + + /* + * The type of the alias. + */ + @JsonProperty(value = "type") + private AliasType type; + + /* + * The default path for an alias. + */ + @JsonProperty(value = "defaultPath") + private String defaultPath; + + /* + * The default pattern for an alias. + */ + @JsonProperty(value = "defaultPattern") + private AliasPattern defaultPattern; + + /* + * The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata + */ + @JsonProperty(value = "defaultMetadata", access = JsonProperty.Access.WRITE_ONLY) + private AliasPathMetadata defaultMetadata; + + /** Creates an instance of Alias class. */ + public Alias() { + } + + /** + * Get the name property: The alias name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The alias name. + * + * @param name the name value to set. + * @return the Alias object itself. + */ + public Alias withName(String name) { + this.name = name; + return this; + } + + /** + * Get the paths property: The paths for an alias. + * + * @return the paths value. + */ + public List paths() { + return this.paths; + } + + /** + * Set the paths property: The paths for an alias. + * + * @param paths the paths value to set. + * @return the Alias object itself. + */ + public Alias withPaths(List paths) { + this.paths = paths; + return this; + } + + /** + * Get the type property: The type of the alias. + * + * @return the type value. + */ + public AliasType type() { + return this.type; + } + + /** + * Set the type property: The type of the alias. + * + * @param type the type value to set. + * @return the Alias object itself. + */ + public Alias withType(AliasType type) { + this.type = type; + return this; + } + + /** + * Get the defaultPath property: The default path for an alias. + * + * @return the defaultPath value. + */ + public String defaultPath() { + return this.defaultPath; + } + + /** + * Set the defaultPath property: The default path for an alias. + * + * @param defaultPath the defaultPath value to set. + * @return the Alias object itself. + */ + public Alias withDefaultPath(String defaultPath) { + this.defaultPath = defaultPath; + return this; + } + + /** + * Get the defaultPattern property: The default pattern for an alias. + * + * @return the defaultPattern value. + */ + public AliasPattern defaultPattern() { + return this.defaultPattern; + } + + /** + * Set the defaultPattern property: The default pattern for an alias. + * + * @param defaultPattern the defaultPattern value to set. + * @return the Alias object itself. + */ + public Alias withDefaultPattern(AliasPattern defaultPattern) { + this.defaultPattern = defaultPattern; + return this; + } + + /** + * Get the defaultMetadata property: The default alias path metadata. Applies to the default path and to any alias + * path that doesn't have metadata. + * + * @return the defaultMetadata value. + */ + public AliasPathMetadata defaultMetadata() { + return this.defaultMetadata; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (paths() != null) { + paths().forEach(e -> e.validate()); + } + if (defaultPattern() != null) { + defaultPattern().validate(); + } + if (defaultMetadata() != null) { + defaultMetadata().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPath.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPath.java new file mode 100644 index 0000000000000..a499c7f792f97 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPath.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The type of the paths for alias. */ +@Fluent +public final class AliasPath { + /* + * The path of an alias. + */ + @JsonProperty(value = "path") + private String path; + + /* + * The API versions. + */ + @JsonProperty(value = "apiVersions") + private List apiVersions; + + /* + * The pattern for an alias path. + */ + @JsonProperty(value = "pattern") + private AliasPattern pattern; + + /* + * The metadata of the alias path. If missing, fall back to the default metadata of the alias. + */ + @JsonProperty(value = "metadata", access = JsonProperty.Access.WRITE_ONLY) + private AliasPathMetadata metadata; + + /** Creates an instance of AliasPath class. */ + public AliasPath() { + } + + /** + * Get the path property: The path of an alias. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path of an alias. + * + * @param path the path value to set. + * @return the AliasPath object itself. + */ + public AliasPath withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the apiVersions property: The API versions. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Set the apiVersions property: The API versions. + * + * @param apiVersions the apiVersions value to set. + * @return the AliasPath object itself. + */ + public AliasPath withApiVersions(List apiVersions) { + this.apiVersions = apiVersions; + return this; + } + + /** + * Get the pattern property: The pattern for an alias path. + * + * @return the pattern value. + */ + public AliasPattern pattern() { + return this.pattern; + } + + /** + * Set the pattern property: The pattern for an alias path. + * + * @param pattern the pattern value to set. + * @return the AliasPath object itself. + */ + public AliasPath withPattern(AliasPattern pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the metadata property: The metadata of the alias path. If missing, fall back to the default metadata of the + * alias. + * + * @return the metadata value. + */ + public AliasPathMetadata metadata() { + return this.metadata; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pattern() != null) { + pattern().validate(); + } + if (metadata() != null) { + metadata().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathAttributes.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathAttributes.java new file mode 100644 index 0000000000000..c485277aca675 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathAttributes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The attributes of the token that the alias path is referring to. */ +public final class AliasPathAttributes extends ExpandableStringEnum { + /** Static value None for AliasPathAttributes. */ + public static final AliasPathAttributes NONE = fromString("None"); + + /** Static value Modifiable for AliasPathAttributes. */ + public static final AliasPathAttributes MODIFIABLE = fromString("Modifiable"); + + /** + * Creates a new instance of AliasPathAttributes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AliasPathAttributes() { + } + + /** + * Creates or finds a AliasPathAttributes from its string representation. + * + * @param name a name to look for. + * @return the corresponding AliasPathAttributes. + */ + @JsonCreator + public static AliasPathAttributes fromString(String name) { + return fromString(name, AliasPathAttributes.class); + } + + /** + * Gets known AliasPathAttributes values. + * + * @return known AliasPathAttributes values. + */ + public static Collection values() { + return values(AliasPathAttributes.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathMetadata.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathMetadata.java new file mode 100644 index 0000000000000..450c6bcdf45e3 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathMetadata.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AliasPathMetadata model. */ +@Immutable +public final class AliasPathMetadata { + /* + * The type of the token that the alias path is referring to. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private AliasPathTokenType type; + + /* + * The attributes of the token that the alias path is referring to. + */ + @JsonProperty(value = "attributes", access = JsonProperty.Access.WRITE_ONLY) + private AliasPathAttributes attributes; + + /** Creates an instance of AliasPathMetadata class. */ + public AliasPathMetadata() { + } + + /** + * Get the type property: The type of the token that the alias path is referring to. + * + * @return the type value. + */ + public AliasPathTokenType type() { + return this.type; + } + + /** + * Get the attributes property: The attributes of the token that the alias path is referring to. + * + * @return the attributes value. + */ + public AliasPathAttributes attributes() { + return this.attributes; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathTokenType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathTokenType.java new file mode 100644 index 0000000000000..853c8a35f228f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPathTokenType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the token that the alias path is referring to. */ +public final class AliasPathTokenType extends ExpandableStringEnum { + /** Static value NotSpecified for AliasPathTokenType. */ + public static final AliasPathTokenType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Any for AliasPathTokenType. */ + public static final AliasPathTokenType ANY = fromString("Any"); + + /** Static value String for AliasPathTokenType. */ + public static final AliasPathTokenType STRING = fromString("String"); + + /** Static value Object for AliasPathTokenType. */ + public static final AliasPathTokenType OBJECT = fromString("Object"); + + /** Static value Array for AliasPathTokenType. */ + public static final AliasPathTokenType ARRAY = fromString("Array"); + + /** Static value Integer for AliasPathTokenType. */ + public static final AliasPathTokenType INTEGER = fromString("Integer"); + + /** Static value Number for AliasPathTokenType. */ + public static final AliasPathTokenType NUMBER = fromString("Number"); + + /** Static value Boolean for AliasPathTokenType. */ + public static final AliasPathTokenType BOOLEAN = fromString("Boolean"); + + /** + * Creates a new instance of AliasPathTokenType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AliasPathTokenType() { + } + + /** + * Creates or finds a AliasPathTokenType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AliasPathTokenType. + */ + @JsonCreator + public static AliasPathTokenType fromString(String name) { + return fromString(name, AliasPathTokenType.class); + } + + /** + * Gets known AliasPathTokenType values. + * + * @return known AliasPathTokenType values. + */ + public static Collection values() { + return values(AliasPathTokenType.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPattern.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPattern.java new file mode 100644 index 0000000000000..5559be67d3cd4 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPattern.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The type of the pattern for an alias path. */ +@Fluent +public final class AliasPattern { + /* + * The alias pattern phrase. + */ + @JsonProperty(value = "phrase") + private String phrase; + + /* + * The alias pattern variable. + */ + @JsonProperty(value = "variable") + private String variable; + + /* + * The type of alias pattern + */ + @JsonProperty(value = "type") + private AliasPatternType type; + + /** Creates an instance of AliasPattern class. */ + public AliasPattern() { + } + + /** + * Get the phrase property: The alias pattern phrase. + * + * @return the phrase value. + */ + public String phrase() { + return this.phrase; + } + + /** + * Set the phrase property: The alias pattern phrase. + * + * @param phrase the phrase value to set. + * @return the AliasPattern object itself. + */ + public AliasPattern withPhrase(String phrase) { + this.phrase = phrase; + return this; + } + + /** + * Get the variable property: The alias pattern variable. + * + * @return the variable value. + */ + public String variable() { + return this.variable; + } + + /** + * Set the variable property: The alias pattern variable. + * + * @param variable the variable value to set. + * @return the AliasPattern object itself. + */ + public AliasPattern withVariable(String variable) { + this.variable = variable; + return this; + } + + /** + * Get the type property: The type of alias pattern. + * + * @return the type value. + */ + public AliasPatternType type() { + return this.type; + } + + /** + * Set the type property: The type of alias pattern. + * + * @param type the type value to set. + * @return the AliasPattern object itself. + */ + public AliasPattern withType(AliasPatternType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPatternType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPatternType.java new file mode 100644 index 0000000000000..233989c5e78bc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasPatternType.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.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The type of alias pattern. */ +public enum AliasPatternType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value Extract. */ + EXTRACT("Extract"); + + /** The actual serialized value for a AliasPatternType instance. */ + private final String value; + + AliasPatternType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AliasPatternType instance. + * + * @param value the serialized value to parse. + * @return the parsed AliasPatternType object, or null if unable to parse. + */ + @JsonCreator + public static AliasPatternType fromString(String value) { + if (value == null) { + return null; + } + AliasPatternType[] items = AliasPatternType.values(); + for (AliasPatternType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasType.java new file mode 100644 index 0000000000000..aa0c08580463d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/AliasType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The type of the alias. */ +public enum AliasType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value PlainText. */ + PLAIN_TEXT("PlainText"), + + /** Enum value Mask. */ + MASK("Mask"); + + /** The actual serialized value for a AliasType instance. */ + private final String value; + + AliasType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AliasType instance. + * + * @param value the serialized value to parse. + * @return the parsed AliasType object, or null if unable to parse. + */ + @JsonCreator + public static AliasType fromString(String value) { + if (value == null) { + return null; + } + AliasType[] items = AliasType.values(); + for (AliasType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ApiProfile.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ApiProfile.java new file mode 100644 index 0000000000000..2bc7ce805c681 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ApiProfile.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApiProfile model. */ +@Immutable +public final class ApiProfile { + /* + * The profile version. + */ + @JsonProperty(value = "profileVersion", access = JsonProperty.Access.WRITE_ONLY) + private String profileVersion; + + /* + * The API version. + */ + @JsonProperty(value = "apiVersion", access = JsonProperty.Access.WRITE_ONLY) + private String apiVersion; + + /** Creates an instance of ApiProfile class. */ + public ApiProfile() { + } + + /** + * Get the profileVersion property: The profile version. + * + * @return the profileVersion value. + */ + public String profileVersion() { + return this.profileVersion; + } + + /** + * Get the apiVersion property: The API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/BasicDependency.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/BasicDependency.java new file mode 100644 index 0000000000000..17b20626995cb --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/BasicDependency.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment dependency information. */ +@Fluent +public final class BasicDependency { + /* + * The ID of the dependency. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The dependency resource type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The dependency resource name. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /** Creates an instance of BasicDependency class. */ + public BasicDependency() { + } + + /** + * Get the id property: The ID of the dependency. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the dependency. + * + * @param id the id value to set. + * @return the BasicDependency object itself. + */ + public BasicDependency withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourceType property: The dependency resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The dependency resource type. + * + * @param resourceType the resourceType value to set. + * @return the BasicDependency object itself. + */ + public BasicDependency withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the resourceName property: The dependency resource name. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The dependency resource name. + * + * @param resourceName the resourceName value to set. + * @return the BasicDependency object itself. + */ + public BasicDependency withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ChangeType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ChangeType.java new file mode 100644 index 0000000000000..18422ab323936 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ChangeType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Type of change that will be made to the resource when the deployment is executed. */ +public enum ChangeType { + /** Enum value Create. */ + CREATE("Create"), + + /** Enum value Delete. */ + DELETE("Delete"), + + /** Enum value Ignore. */ + IGNORE("Ignore"), + + /** Enum value Deploy. */ + DEPLOY("Deploy"), + + /** Enum value NoChange. */ + NO_CHANGE("NoChange"), + + /** Enum value Modify. */ + MODIFY("Modify"), + + /** Enum value Unsupported. */ + UNSUPPORTED("Unsupported"); + + /** The actual serialized value for a ChangeType instance. */ + private final String value; + + ChangeType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ChangeType instance. + * + * @param value the serialized value to parse. + * @return the parsed ChangeType object, or null if unable to parse. + */ + @JsonCreator + public static ChangeType fromString(String value) { + if (value == null) { + return null; + } + ChangeType[] items = ChangeType.values(); + for (ChangeType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DebugSetting.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DebugSetting.java new file mode 100644 index 0000000000000..e1b8c42e511b3 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DebugSetting.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The debug setting. */ +@Fluent +public final class DebugSetting { + /* + * Specifies the type of information to log for debugging. The permitted values are none, requestContent, + * responseContent, or both requestContent and responseContent separated by a comma. The default is none. When + * setting this value, carefully consider the type of information you are passing in during deployment. By logging + * information about the request or response, you could potentially expose sensitive data that is retrieved through + * the deployment operations. + */ + @JsonProperty(value = "detailLevel") + private String detailLevel; + + /** Creates an instance of DebugSetting class. */ + public DebugSetting() { + } + + /** + * Get the detailLevel property: Specifies the type of information to log for debugging. The permitted values are + * none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The + * default is none. When setting this value, carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could potentially expose sensitive data + * that is retrieved through the deployment operations. + * + * @return the detailLevel value. + */ + public String detailLevel() { + return this.detailLevel; + } + + /** + * Set the detailLevel property: Specifies the type of information to log for debugging. The permitted values are + * none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The + * default is none. When setting this value, carefully consider the type of information you are passing in during + * deployment. By logging information about the request or response, you could potentially expose sensitive data + * that is retrieved through the deployment operations. + * + * @param detailLevel the detailLevel value to set. + * @return the DebugSetting object itself. + */ + public DebugSetting withDetailLevel(String detailLevel) { + this.detailLevel = detailLevel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Dependency.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Dependency.java new file mode 100644 index 0000000000000..ec5f7974cb1f6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Dependency.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Deployment dependency information. */ +@Fluent +public final class Dependency { + /* + * The list of dependencies. + */ + @JsonProperty(value = "dependsOn") + private List dependsOn; + + /* + * The ID of the dependency. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The dependency resource type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The dependency resource name. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /** Creates an instance of Dependency class. */ + public Dependency() { + } + + /** + * Get the dependsOn property: The list of dependencies. + * + * @return the dependsOn value. + */ + public List dependsOn() { + return this.dependsOn; + } + + /** + * Set the dependsOn property: The list of dependencies. + * + * @param dependsOn the dependsOn value to set. + * @return the Dependency object itself. + */ + public Dependency withDependsOn(List dependsOn) { + this.dependsOn = dependsOn; + return this; + } + + /** + * Get the id property: The ID of the dependency. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the dependency. + * + * @param id the id value to set. + * @return the Dependency object itself. + */ + public Dependency withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourceType property: The dependency resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The dependency resource type. + * + * @param resourceType the resourceType value to set. + * @return the Dependency object itself. + */ + public Dependency withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the resourceName property: The dependency resource name. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The dependency resource name. + * + * @param resourceName the resourceName value to set. + * @return the Dependency object itself. + */ + public Dependency withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dependsOn() != null) { + dependsOn().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployment.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployment.java new file mode 100644 index 0000000000000..b94130b3d336b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployment.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Deployment operation parameters. */ +@Fluent +public final class Deployment { + /* + * The location to store the deployment data. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The deployment properties. + */ + @JsonProperty(value = "properties", required = true) + private DeploymentProperties properties; + + /* + * Deployment tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of Deployment class. */ + public Deployment() { + } + + /** + * Get the location property: The location to store the deployment data. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location to store the deployment data. + * + * @param location the location value to set. + * @return the Deployment object itself. + */ + public Deployment withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: The deployment properties. + * + * @return the properties value. + */ + public DeploymentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The deployment properties. + * + * @param properties the properties value to set. + * @return the Deployment object itself. + */ + public Deployment withProperties(DeploymentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Deployment tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Deployment tags. + * + * @param tags the tags value to set. + * @return the Deployment object itself. + */ + public Deployment withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model Deployment")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Deployment.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExportResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExportResult.java new file mode 100644 index 0000000000000..63d38a22245c8 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExportResult.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExportResultInner; + +/** An immutable client-side representation of DeploymentExportResult. */ +public interface DeploymentExportResult { + /** + * Gets the template property: The template content. + * + * @return the template value. + */ + Object template(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExportResultInner object. + * + * @return the inner object. + */ + DeploymentExportResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExtended.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExtended.java new file mode 100644 index 0000000000000..a8d30f6980517 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentExtended.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExtendedInner; +import java.util.Map; + +/** An immutable client-side representation of DeploymentExtended. */ +public interface DeploymentExtended { + /** + * 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: Deployment properties. + * + * @return the properties value. + */ + DeploymentPropertiesExtended properties(); + + /** + * 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.resources.generated.fluent.models.DeploymentExtendedInner object. + * + * @return the inner object. + */ + DeploymentExtendedInner innerModel(); + + /** The entirety of the DeploymentExtended definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The DeploymentExtended definition stages. */ + interface DefinitionStages { + /** The first stage of the DeploymentExtended definition. */ + interface Blank extends WithResourceGroup { + } + /** The stage of the DeploymentExtended definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group to deploy the resources to. The name is case + * insensitive. The resource group must already exist. + * @return the next definition stage. + */ + WithProperties withExistingResourceGroup(String resourceGroupName); + } + /** The stage of the DeploymentExtended definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The deployment properties.. + * + * @param properties The deployment properties. + * @return the next definition stage. + */ + WithCreate withProperties(DeploymentProperties properties); + } + /** + * The stage of the DeploymentExtended 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.WithLocation, DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + DeploymentExtended create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DeploymentExtended create(Context context); + } + /** The stage of the DeploymentExtended definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location to store the deployment data. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location to store the deployment data. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** The stage of the DeploymentExtended definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Deployment tags. + * + * @param tags Deployment tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + /** + * Begins update for the DeploymentExtended resource. + * + * @return the stage of resource update. + */ + DeploymentExtended.Update update(); + + /** The template for DeploymentExtended update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DeploymentExtended apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DeploymentExtended apply(Context context); + } + /** The DeploymentExtended update stages. */ + interface UpdateStages { + /** The stage of the DeploymentExtended update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Deployment tags. + * + * @param tags Deployment tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the DeploymentExtended update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The deployment properties.. + * + * @param properties The deployment properties. + * @return the next definition stage. + */ + Update withProperties(DeploymentProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DeploymentExtended refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DeploymentExtended refresh(Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelWithResponse(Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @throws com.azure.core.management.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 cancel(); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validate(Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validate(Deployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIf(DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIf(DeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + Response exportTemplateWithResponse(Context context); + + /** + * Exports the template used for specified deployment. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + DeploymentExportResult exportTemplate(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentListResult.java new file mode 100644 index 0000000000000..17af45d07dbab --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentExtendedInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of deployments. */ +@Fluent +public final class DeploymentListResult { + /* + * An array of deployments. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of DeploymentListResult class. */ + public DeploymentListResult() { + } + + /** + * Get the value property: An array of deployments. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of deployments. + * + * @param value the value value to set. + * @return the DeploymentListResult object itself. + */ + public DeploymentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentMode.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentMode.java new file mode 100644 index 0000000000000..79c73da26cd06 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentMode.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.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, + * resources are deployed without deleting existing resources that are not included in the template. In Complete mode, + * resources are deployed and existing resources in the resource group that are not included in the template are + * deleted. Be careful when using Complete mode as you may unintentionally delete resources. + */ +public enum DeploymentMode { + /** Enum value Incremental. */ + INCREMENTAL("Incremental"), + + /** Enum value Complete. */ + COMPLETE("Complete"); + + /** The actual serialized value for a DeploymentMode instance. */ + private final String value; + + DeploymentMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DeploymentMode instance. + * + * @param value the serialized value to parse. + * @return the parsed DeploymentMode object, or null if unable to parse. + */ + @JsonCreator + public static DeploymentMode fromString(String value) { + if (value == null) { + return null; + } + DeploymentMode[] items = DeploymentMode.values(); + for (DeploymentMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperation.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperation.java new file mode 100644 index 0000000000000..bb81ec8a6f7ec --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperation.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner; + +/** An immutable client-side representation of DeploymentOperation. */ +public interface DeploymentOperation { + /** + * Gets the id property: Full deployment operation ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the operationId property: Deployment operation ID. + * + * @return the operationId value. + */ + String operationId(); + + /** + * Gets the properties property: Deployment properties. + * + * @return the properties value. + */ + DeploymentOperationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner object. + * + * @return the inner object. + */ + DeploymentOperationInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationProperties.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationProperties.java new file mode 100644 index 0000000000000..ad648a77ab6a8 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationProperties.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Deployment operation properties. */ +@Immutable +public final class DeploymentOperationProperties { + /* + * The name of the current provisioning operation. + */ + @JsonProperty(value = "provisioningOperation", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningOperation provisioningOperation; + + /* + * The state of the provisioning. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The date and time of the operation. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * The duration of the operation. + */ + @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) + private String duration; + + /* + * Deployment operation service request id. + */ + @JsonProperty(value = "serviceRequestId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceRequestId; + + /* + * Operation status code from the resource provider. This property may not be set if a response has not yet been + * received. + */ + @JsonProperty(value = "statusCode", access = JsonProperty.Access.WRITE_ONLY) + private String statusCode; + + /* + * Operation status message from the resource provider. This property is optional. It will only be provided if an + * error was received from the resource provider. + */ + @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) + private StatusMessage statusMessage; + + /* + * The target resource. + */ + @JsonProperty(value = "targetResource", access = JsonProperty.Access.WRITE_ONLY) + private TargetResource targetResource; + + /* + * The HTTP request message. + */ + @JsonProperty(value = "request", access = JsonProperty.Access.WRITE_ONLY) + private HttpMessage request; + + /* + * The HTTP response message. + */ + @JsonProperty(value = "response", access = JsonProperty.Access.WRITE_ONLY) + private HttpMessage response; + + /** Creates an instance of DeploymentOperationProperties class. */ + public DeploymentOperationProperties() { + } + + /** + * Get the provisioningOperation property: The name of the current provisioning operation. + * + * @return the provisioningOperation value. + */ + public ProvisioningOperation provisioningOperation() { + return this.provisioningOperation; + } + + /** + * Get the provisioningState property: The state of the provisioning. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the timestamp property: The date and time of the operation. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the duration property: The duration of the operation. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the serviceRequestId property: Deployment operation service request id. + * + * @return the serviceRequestId value. + */ + public String serviceRequestId() { + return this.serviceRequestId; + } + + /** + * Get the statusCode property: Operation status code from the resource provider. This property may not be set if a + * response has not yet been received. + * + * @return the statusCode value. + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Get the statusMessage property: Operation status message from the resource provider. This property is optional. + * It will only be provided if an error was received from the resource provider. + * + * @return the statusMessage value. + */ + public StatusMessage statusMessage() { + return this.statusMessage; + } + + /** + * Get the targetResource property: The target resource. + * + * @return the targetResource value. + */ + public TargetResource targetResource() { + return this.targetResource; + } + + /** + * Get the request property: The HTTP request message. + * + * @return the request value. + */ + public HttpMessage request() { + return this.request; + } + + /** + * Get the response property: The HTTP response message. + * + * @return the response value. + */ + public HttpMessage response() { + return this.response; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (statusMessage() != null) { + statusMessage().validate(); + } + if (targetResource() != null) { + targetResource().validate(); + } + if (request() != null) { + request().validate(); + } + if (response() != null) { + response().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperations.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperations.java new file mode 100644 index 0000000000000..a796737db0f7d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperations.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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 DeploymentOperations. */ +public interface DeploymentOperations { + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + Response getAtScopeWithResponse( + String scope, String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + DeploymentOperation getAtScope(String scope, String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtScope(String scope, String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtScope(String scope, String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + Response getAtTenantScopeWithResponse( + String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + DeploymentOperation getAtTenantScope(String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtTenantScope(String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtTenantScope(String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + DeploymentOperation getAtManagementGroupScope(String groupId, String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtManagementGroupScope( + String groupId, String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + Response getAtSubscriptionScopeWithResponse( + String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + DeploymentOperation getAtSubscriptionScope(String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtSubscriptionScope(String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtSubscriptionScope(String deploymentName, Integer top, Context context); + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String deploymentName, String operationId, Context context); + + /** + * Gets a deployments operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId The ID of the operation to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployments operation. + */ + DeploymentOperation get(String resourceGroupName, String deploymentName, String operationId); + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Gets all deployments operations for a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top The number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all deployments operations for a deployment as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String deploymentName, Integer top, Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationsListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationsListResult.java new file mode 100644 index 0000000000000..2e21e39813d45 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentOperationsListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentOperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of deployment operations. */ +@Fluent +public final class DeploymentOperationsListResult { + /* + * An array of deployment operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of DeploymentOperationsListResult class. */ + public DeploymentOperationsListResult() { + } + + /** + * Get the value property: An array of deployment operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of deployment operations. + * + * @param value the value value to set. + * @return the DeploymentOperationsListResult object itself. + */ + public DeploymentOperationsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentProperties.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentProperties.java new file mode 100644 index 0000000000000..d273ee238c18d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentProperties.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment properties. */ +@Fluent +public class DeploymentProperties { + /* + * The template content. You use this element when you want to pass the template syntax directly in the request + * rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the + * templateLink property or the template property, but not both. + */ + @JsonProperty(value = "template") + private Object template; + + /* + * The URI of the template. Use either the templateLink property or the template property, but not both. + */ + @JsonProperty(value = "templateLink") + private TemplateLink templateLink; + + /* + * Name and value pairs that define the deployment parameters for the template. You use this element when you want + * to provide the parameter values directly in the request rather than link to an existing parameter file. Use + * either the parametersLink property or the parameters property, but not both. It can be a JObject or a well + * formed JSON string. + */ + @JsonProperty(value = "parameters") + private Object parameters; + + /* + * The URI of parameters file. You use this element to link to an existing parameters file. Use either the + * parametersLink property or the parameters property, but not both. + */ + @JsonProperty(value = "parametersLink") + private ParametersLink parametersLink; + + /* + * The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental + * mode, resources are deployed without deleting existing resources that are not included in the template. In + * Complete mode, resources are deployed and existing resources in the resource group that are not included in the + * template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. + */ + @JsonProperty(value = "mode", required = true) + private DeploymentMode mode; + + /* + * The debug setting of the deployment. + */ + @JsonProperty(value = "debugSetting") + private DebugSetting debugSetting; + + /* + * The deployment on error behavior. + */ + @JsonProperty(value = "onErrorDeployment") + private OnErrorDeployment onErrorDeployment; + + /* + * Specifies whether template expressions are evaluated within the scope of the parent template or nested template. + * Only applicable to nested templates. If not specified, default value is outer. + */ + @JsonProperty(value = "expressionEvaluationOptions") + private ExpressionEvaluationOptions expressionEvaluationOptions; + + /** Creates an instance of DeploymentProperties class. */ + public DeploymentProperties() { + } + + /** + * Get the template property: The template content. You use this element when you want to pass the template syntax + * directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. + * Use either the templateLink property or the template property, but not both. + * + * @return the template value. + */ + public Object template() { + return this.template; + } + + /** + * Set the template property: The template content. You use this element when you want to pass the template syntax + * directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. + * Use either the templateLink property or the template property, but not both. + * + * @param template the template value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withTemplate(Object template) { + this.template = template; + return this; + } + + /** + * Get the templateLink property: The URI of the template. Use either the templateLink property or the template + * property, but not both. + * + * @return the templateLink value. + */ + public TemplateLink templateLink() { + return this.templateLink; + } + + /** + * Set the templateLink property: The URI of the template. Use either the templateLink property or the template + * property, but not both. + * + * @param templateLink the templateLink value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withTemplateLink(TemplateLink templateLink) { + this.templateLink = templateLink; + return this; + } + + /** + * Get the parameters property: Name and value pairs that define the deployment parameters for the template. You use + * this element when you want to provide the parameter values directly in the request rather than link to an + * existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can + * be a JObject or a well formed JSON string. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Name and value pairs that define the deployment parameters for the template. You use + * this element when you want to provide the parameter values directly in the request rather than link to an + * existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can + * be a JObject or a well formed JSON string. + * + * @param parameters the parameters value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withParameters(Object parameters) { + this.parameters = parameters; + return this; + } + + /** + * Get the parametersLink property: The URI of parameters file. You use this element to link to an existing + * parameters file. Use either the parametersLink property or the parameters property, but not both. + * + * @return the parametersLink value. + */ + public ParametersLink parametersLink() { + return this.parametersLink; + } + + /** + * Set the parametersLink property: The URI of parameters file. You use this element to link to an existing + * parameters file. Use either the parametersLink property or the parameters property, but not both. + * + * @param parametersLink the parametersLink value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withParametersLink(ParametersLink parametersLink) { + this.parametersLink = parametersLink; + return this; + } + + /** + * Get the mode property: The mode that is used to deploy resources. This value can be either Incremental or + * Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included + * in the template. In Complete mode, resources are deployed and existing resources in the resource group that are + * not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete + * resources. + * + * @return the mode value. + */ + public DeploymentMode mode() { + return this.mode; + } + + /** + * Set the mode property: The mode that is used to deploy resources. This value can be either Incremental or + * Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included + * in the template. In Complete mode, resources are deployed and existing resources in the resource group that are + * not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete + * resources. + * + * @param mode the mode value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withMode(DeploymentMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the debugSetting property: The debug setting of the deployment. + * + * @return the debugSetting value. + */ + public DebugSetting debugSetting() { + return this.debugSetting; + } + + /** + * Set the debugSetting property: The debug setting of the deployment. + * + * @param debugSetting the debugSetting value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withDebugSetting(DebugSetting debugSetting) { + this.debugSetting = debugSetting; + return this; + } + + /** + * Get the onErrorDeployment property: The deployment on error behavior. + * + * @return the onErrorDeployment value. + */ + public OnErrorDeployment onErrorDeployment() { + return this.onErrorDeployment; + } + + /** + * Set the onErrorDeployment property: The deployment on error behavior. + * + * @param onErrorDeployment the onErrorDeployment value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withOnErrorDeployment(OnErrorDeployment onErrorDeployment) { + this.onErrorDeployment = onErrorDeployment; + return this; + } + + /** + * Get the expressionEvaluationOptions property: Specifies whether template expressions are evaluated within the + * scope of the parent template or nested template. Only applicable to nested templates. If not specified, default + * value is outer. + * + * @return the expressionEvaluationOptions value. + */ + public ExpressionEvaluationOptions expressionEvaluationOptions() { + return this.expressionEvaluationOptions; + } + + /** + * Set the expressionEvaluationOptions property: Specifies whether template expressions are evaluated within the + * scope of the parent template or nested template. Only applicable to nested templates. If not specified, default + * value is outer. + * + * @param expressionEvaluationOptions the expressionEvaluationOptions value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withExpressionEvaluationOptions( + ExpressionEvaluationOptions expressionEvaluationOptions) { + this.expressionEvaluationOptions = expressionEvaluationOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templateLink() != null) { + templateLink().validate(); + } + if (parametersLink() != null) { + parametersLink().validate(); + } + if (mode() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property mode in model DeploymentProperties")); + } + if (debugSetting() != null) { + debugSetting().validate(); + } + if (onErrorDeployment() != null) { + onErrorDeployment().validate(); + } + if (expressionEvaluationOptions() != null) { + expressionEvaluationOptions().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentProperties.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentPropertiesExtended.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentPropertiesExtended.java new file mode 100644 index 0000000000000..0ece4f5888bb2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentPropertiesExtended.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Deployment properties with additional details. */ +@Immutable +public final class DeploymentPropertiesExtended { + /* + * Denotes the state of provisioning. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The correlation ID of the deployment. + */ + @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY) + private String correlationId; + + /* + * The timestamp of the template deployment. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime timestamp; + + /* + * The duration of the template deployment. + */ + @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) + private String duration; + + /* + * Key/value pairs that represent deployment output. + */ + @JsonProperty(value = "outputs", access = JsonProperty.Access.WRITE_ONLY) + private Object outputs; + + /* + * The list of resource providers needed for the deployment. + */ + @JsonProperty(value = "providers", access = JsonProperty.Access.WRITE_ONLY) + private List providers; + + /* + * The list of deployment dependencies. + */ + @JsonProperty(value = "dependencies", access = JsonProperty.Access.WRITE_ONLY) + private List dependencies; + + /* + * The URI referencing the template. + */ + @JsonProperty(value = "templateLink", access = JsonProperty.Access.WRITE_ONLY) + private TemplateLink templateLink; + + /* + * Deployment parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private Object parameters; + + /* + * The URI referencing the parameters. + */ + @JsonProperty(value = "parametersLink", access = JsonProperty.Access.WRITE_ONLY) + private ParametersLink parametersLink; + + /* + * The deployment mode. Possible values are Incremental and Complete. + */ + @JsonProperty(value = "mode", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentMode mode; + + /* + * The debug setting of the deployment. + */ + @JsonProperty(value = "debugSetting", access = JsonProperty.Access.WRITE_ONLY) + private DebugSetting debugSetting; + + /* + * The deployment on error behavior. + */ + @JsonProperty(value = "onErrorDeployment", access = JsonProperty.Access.WRITE_ONLY) + private OnErrorDeploymentExtended onErrorDeployment; + + /* + * The hash produced for the template. + */ + @JsonProperty(value = "templateHash", access = JsonProperty.Access.WRITE_ONLY) + private String templateHash; + + /* + * Array of provisioned resources. + */ + @JsonProperty(value = "outputResources", access = JsonProperty.Access.WRITE_ONLY) + private List outputResources; + + /* + * Array of validated resources. + */ + @JsonProperty(value = "validatedResources", access = JsonProperty.Access.WRITE_ONLY) + private List validatedResources; + + /* + * Error Response + * + * The deployment error. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private ManagementError error; + + /** Creates an instance of DeploymentPropertiesExtended class. */ + public DeploymentPropertiesExtended() { + } + + /** + * Get the provisioningState property: Denotes the state of provisioning. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the correlationId property: The correlation ID of the deployment. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Get the timestamp property: The timestamp of the template deployment. + * + * @return the timestamp value. + */ + public OffsetDateTime timestamp() { + return this.timestamp; + } + + /** + * Get the duration property: The duration of the template deployment. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the outputs property: Key/value pairs that represent deployment output. + * + * @return the outputs value. + */ + public Object outputs() { + return this.outputs; + } + + /** + * Get the providers property: The list of resource providers needed for the deployment. + * + * @return the providers value. + */ + public List providers() { + return this.providers; + } + + /** + * Get the dependencies property: The list of deployment dependencies. + * + * @return the dependencies value. + */ + public List dependencies() { + return this.dependencies; + } + + /** + * Get the templateLink property: The URI referencing the template. + * + * @return the templateLink value. + */ + public TemplateLink templateLink() { + return this.templateLink; + } + + /** + * Get the parameters property: Deployment parameters. + * + * @return the parameters value. + */ + public Object parameters() { + return this.parameters; + } + + /** + * Get the parametersLink property: The URI referencing the parameters. + * + * @return the parametersLink value. + */ + public ParametersLink parametersLink() { + return this.parametersLink; + } + + /** + * Get the mode property: The deployment mode. Possible values are Incremental and Complete. + * + * @return the mode value. + */ + public DeploymentMode mode() { + return this.mode; + } + + /** + * Get the debugSetting property: The debug setting of the deployment. + * + * @return the debugSetting value. + */ + public DebugSetting debugSetting() { + return this.debugSetting; + } + + /** + * Get the onErrorDeployment property: The deployment on error behavior. + * + * @return the onErrorDeployment value. + */ + public OnErrorDeploymentExtended onErrorDeployment() { + return this.onErrorDeployment; + } + + /** + * Get the templateHash property: The hash produced for the template. + * + * @return the templateHash value. + */ + public String templateHash() { + return this.templateHash; + } + + /** + * Get the outputResources property: Array of provisioned resources. + * + * @return the outputResources value. + */ + public List outputResources() { + return this.outputResources; + } + + /** + * Get the validatedResources property: Array of validated resources. + * + * @return the validatedResources value. + */ + public List validatedResources() { + return this.validatedResources; + } + + /** + * Get the error property: Error Response + * + *

The deployment error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (providers() != null) { + providers().forEach(e -> e.validate()); + } + if (dependencies() != null) { + dependencies().forEach(e -> e.validate()); + } + if (templateLink() != null) { + templateLink().validate(); + } + if (parametersLink() != null) { + parametersLink().validate(); + } + if (debugSetting() != null) { + debugSetting().validate(); + } + if (onErrorDeployment() != null) { + onErrorDeployment().validate(); + } + if (outputResources() != null) { + outputResources().forEach(e -> e.validate()); + } + if (validatedResources() != null) { + validatedResources().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentValidateResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentValidateResult.java new file mode 100644 index 0000000000000..1810a1c455348 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentValidateResult.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.DeploymentValidateResultInner; + +/** An immutable client-side representation of DeploymentValidateResult. */ +public interface DeploymentValidateResult { + /** + * Gets the error property: Error Response + * + *

The deployment validation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the properties property: The template deployment properties. + * + * @return the properties value. + */ + DeploymentPropertiesExtended properties(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.DeploymentValidateResultInner object. + * + * @return the inner object. + */ + DeploymentValidateResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIf.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIf.java new file mode 100644 index 0000000000000..7ab0d7d18a9e6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIf.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment What-if operation parameters. */ +@Fluent +public final class DeploymentWhatIf { + /* + * The location to store the deployment data. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The deployment properties. + */ + @JsonProperty(value = "properties", required = true) + private DeploymentWhatIfProperties properties; + + /** Creates an instance of DeploymentWhatIf class. */ + public DeploymentWhatIf() { + } + + /** + * Get the location property: The location to store the deployment data. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location to store the deployment data. + * + * @param location the location value to set. + * @return the DeploymentWhatIf object itself. + */ + public DeploymentWhatIf withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: The deployment properties. + * + * @return the properties value. + */ + public DeploymentWhatIfProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The deployment properties. + * + * @param properties the properties value to set. + * @return the DeploymentWhatIf object itself. + */ + public DeploymentWhatIf withProperties(DeploymentWhatIfProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model DeploymentWhatIf")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentWhatIf.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfProperties.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfProperties.java new file mode 100644 index 0000000000000..1f2e027e446a9 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfProperties.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment What-if properties. */ +@Fluent +public final class DeploymentWhatIfProperties extends DeploymentProperties { + /* + * Optional What-If operation settings. + */ + @JsonProperty(value = "whatIfSettings") + private DeploymentWhatIfSettings whatIfSettings; + + /** Creates an instance of DeploymentWhatIfProperties class. */ + public DeploymentWhatIfProperties() { + } + + /** + * Get the whatIfSettings property: Optional What-If operation settings. + * + * @return the whatIfSettings value. + */ + public DeploymentWhatIfSettings whatIfSettings() { + return this.whatIfSettings; + } + + /** + * Set the whatIfSettings property: Optional What-If operation settings. + * + * @param whatIfSettings the whatIfSettings value to set. + * @return the DeploymentWhatIfProperties object itself. + */ + public DeploymentWhatIfProperties withWhatIfSettings(DeploymentWhatIfSettings whatIfSettings) { + this.whatIfSettings = whatIfSettings; + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withTemplate(Object template) { + super.withTemplate(template); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withTemplateLink(TemplateLink templateLink) { + super.withTemplateLink(templateLink); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withParameters(Object parameters) { + super.withParameters(parameters); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withParametersLink(ParametersLink parametersLink) { + super.withParametersLink(parametersLink); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withMode(DeploymentMode mode) { + super.withMode(mode); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withDebugSetting(DebugSetting debugSetting) { + super.withDebugSetting(debugSetting); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withOnErrorDeployment(OnErrorDeployment onErrorDeployment) { + super.withOnErrorDeployment(onErrorDeployment); + return this; + } + + /** {@inheritDoc} */ + @Override + public DeploymentWhatIfProperties withExpressionEvaluationOptions( + ExpressionEvaluationOptions expressionEvaluationOptions) { + super.withExpressionEvaluationOptions(expressionEvaluationOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (whatIfSettings() != null) { + whatIfSettings().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfSettings.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfSettings.java new file mode 100644 index 0000000000000..6e86721302bf0 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/DeploymentWhatIfSettings.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment What-If operation settings. */ +@Fluent +public final class DeploymentWhatIfSettings { + /* + * The format of the What-If results + */ + @JsonProperty(value = "resultFormat") + private WhatIfResultFormat resultFormat; + + /** Creates an instance of DeploymentWhatIfSettings class. */ + public DeploymentWhatIfSettings() { + } + + /** + * Get the resultFormat property: The format of the What-If results. + * + * @return the resultFormat value. + */ + public WhatIfResultFormat resultFormat() { + return this.resultFormat; + } + + /** + * Set the resultFormat property: The format of the What-If results. + * + * @param resultFormat the resultFormat value to set. + * @return the DeploymentWhatIfSettings object itself. + */ + public DeploymentWhatIfSettings withResultFormat(WhatIfResultFormat resultFormat) { + this.resultFormat = resultFormat; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployments.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployments.java new file mode 100644 index 0000000000000..6f7e6b7c1bee5 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Deployments.java @@ -0,0 +1,1325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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 Deployments. */ +public interface Deployments { + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistenceAtScope(String scope, String deploymentName); + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtScope(String scope, String deploymentName, Deployment parameters); + + /** + * Deploys resources at a given scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtScope( + String scope, String deploymentName, Deployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + Response getAtScopeWithResponse(String scope, String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + DeploymentExtended getAtScope(String scope, String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtScopeWithResponse(String scope, String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtScope(String scope, String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtScope(String scope, String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtScope( + String scope, String deploymentName, Deployment parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + Response exportTemplateAtScopeWithResponse( + String scope, String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param scope The resource scope. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + DeploymentExportResult exportTemplateAtScope(String scope, String deploymentName); + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtScope(String scope); + + /** + * Get all the deployments at the given scope. + * + * @param scope The resource scope. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the given scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtScope(String scope, String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtTenantScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtTenantScope(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistenceAtTenantScope(String deploymentName); + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters); + + /** + * Deploys resources at tenant scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + Response getAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + DeploymentExtended getAtTenantScope(String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtTenantScope(String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtTenantScope(String deploymentName, ScopedDeployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtTenantScope(String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the tenant group. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIfAtTenantScope( + String deploymentName, ScopedDeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + Response exportTemplateAtTenantScopeWithResponse(String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + DeploymentExportResult exportTemplateAtTenantScope(String deploymentName); + + /** + * Get all the deployments at the tenant scope. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtTenantScope(); + + /** + * Get all the deployments at the tenant scope. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments at the tenant scope as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtTenantScope(String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtManagementGroupScope(String groupId, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters); + + /** + * Deploys resources at management group scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + Response getAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + DeploymentExtended getAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtManagementGroupScopeWithResponse(String groupId, String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the management group. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIfAtManagementGroupScope( + String groupId, String deploymentName, ScopedDeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + Response exportTemplateAtManagementGroupScopeWithResponse( + String groupId, String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param groupId The management group ID. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + DeploymentExportResult exportTemplateAtManagementGroupScope(String groupId, String deploymentName); + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group 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 all the deployments for a management group as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtManagementGroupScope(String groupId); + + /** + * Get all the deployments for a management group. + * + * @param groupId The management group ID. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a management group as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtManagementGroupScope( + String groupId, String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtSubscriptionScope(String deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. This is an asynchronous operation that returns a status of 202 until the + * template deployment is successfully deleted. The Location response header contains the URI that is used to obtain + * the status of the process. While the process is running, a call to the URI in the Location header returns a + * status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If + * the asynchronous request failed, the URI in the Location header returns an error-level status code. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtSubscriptionScope(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceAtSubscriptionScopeWithResponse(String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistenceAtSubscriptionScope(String deploymentName); + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters); + + /** + * Deploys resources at subscription scope. + * + *

You can provide the template and parameters directly in the request or link to JSON files. + * + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment information. + */ + DeploymentExtended createOrUpdateAtSubscriptionScope(String deploymentName, Deployment parameters, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + Response getAtSubscriptionScopeWithResponse(String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + DeploymentExtended getAtSubscriptionScope(String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelAtSubscriptionScopeWithResponse(String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resources partially deployed. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancelAtSubscriptionScope(String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtSubscriptionScope(String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validateAtSubscriptionScope(String deploymentName, Deployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIfAtSubscriptionScope(String deploymentName, DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the subscription. + * + * @param deploymentName The name of the deployment. + * @param parameters Parameters to What If. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIfAtSubscriptionScope( + String deploymentName, DeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + Response exportTemplateAtSubscriptionScopeWithResponse( + String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + DeploymentExportResult exportTemplateAtSubscriptionScope(String deploymentName); + + /** + * Get all the deployments for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get all the deployments for a subscription. + * + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Integer top, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deploymentName); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @param resourceGroupName The name of the resource group with the deployment to delete. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceWithResponse(String resourceGroupName, String deploymentName, Context context); + + /** + * Checks whether the deployment exists. + * + * @param resourceGroupName The name of the resource group with the deployment to check. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistence(String resourceGroupName, String deploymentName); + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String deploymentName, Context context); + + /** + * Gets a deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 deployment. + */ + DeploymentExtended getByResourceGroup(String resourceGroupName, String deploymentName); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 cancelWithResponse(String resourceGroupName, String deploymentName, Context context); + + /** + * Cancels a currently running template deployment. + * + *

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is + * canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running + * template deployment and leaves the resource group partially deployed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 cancel(String resourceGroupName, String deploymentName); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validate(String resourceGroupName, String deploymentName, Deployment parameters); + + /** + * Validates whether the specified template is syntactically correct and will be accepted by Azure Resource + * Manager.. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information from validate template deployment response. + */ + DeploymentValidateResult validate( + String resourceGroupName, String deploymentName, Deployment parameters, Context context); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIf(String resourceGroupName, String deploymentName, DeploymentWhatIf parameters); + + /** + * Returns changes that will be made by the deployment if executed at the scope of the resource group. + * + * @param resourceGroupName The name of the resource group the template will be deployed to. The name is case + * insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Parameters to validate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the What-If operation. + */ + WhatIfOperationResult whatIf( + String resourceGroupName, String deploymentName, DeploymentWhatIf parameters, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result along with {@link Response}. + */ + Response exportTemplateWithResponse( + String resourceGroupName, String deploymentName, Context context); + + /** + * Exports the template used for specified deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment export result. + */ + DeploymentExportResult exportTemplate(String resourceGroupName, String deploymentName); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the deployments for a resource group. + * + * @param resourceGroupName The name of the resource group with the deployments to get. The name is case + * insensitive. + * @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq + * '{state}'. + * @param top The number of results to get. If null is passed, returns all deployments. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the deployments for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash along with {@link Response}. + */ + Response calculateTemplateHashWithResponse(Object template, Context context); + + /** + * Calculate the hash of the given template. + * + * @param template The template provided to calculate hash. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to calculate template hash. + */ + TemplateHashResult calculateTemplateHash(Object template); + + /** + * Gets a deployment. + * + * @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 deployment along with {@link Response}. + */ + DeploymentExtended getById(String id); + + /** + * Gets a deployment. + * + * @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 deployment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @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 deployment from the deployment history. + * + *

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the + * associated deployment operations. Deleting a template deployment does not affect the state of the resource group. + * This is an asynchronous operation that returns a status of 202 until the template deployment is successfully + * deleted. The Location response header contains the URI that is used to obtain the status of the process. While + * the process is running, a call to the URI in the Location header returns a status of 202. When the process + * finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, + * the URI in the Location header returns an error-level status code. + * + * @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 DeploymentExtended resource. + * + * @param name resource name. + * @return the first stage of the new DeploymentExtended definition. + */ + DeploymentExtended.DefinitionStages.Blank define(String name); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExportTemplateRequest.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExportTemplateRequest.java new file mode 100644 index 0000000000000..f64293c7f96b3 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExportTemplateRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Export resource group template request parameters. */ +@Fluent +public final class ExportTemplateRequest { + /* + * The IDs of the resources to filter the export by. To export all resources, supply an array with single entry + * '*'. + */ + @JsonProperty(value = "resources") + private List resources; + + /* + * The export template options. A CSV-formatted list containing zero or more of the following: + * 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', 'SkipAllParameterization' + */ + @JsonProperty(value = "options") + private String options; + + /** Creates an instance of ExportTemplateRequest class. */ + public ExportTemplateRequest() { + } + + /** + * Get the resources property: The IDs of the resources to filter the export by. To export all resources, supply an + * array with single entry '*'. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: The IDs of the resources to filter the export by. To export all resources, supply an + * array with single entry '*'. + * + * @param resources the resources value to set. + * @return the ExportTemplateRequest object itself. + */ + public ExportTemplateRequest withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Get the options property: The export template options. A CSV-formatted list containing zero or more of the + * following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', + * 'SkipAllParameterization'. + * + * @return the options value. + */ + public String options() { + return this.options; + } + + /** + * Set the options property: The export template options. A CSV-formatted list containing zero or more of the + * following: 'IncludeParameterDefaultValue', 'IncludeComments', 'SkipResourceNameParameterization', + * 'SkipAllParameterization'. + * + * @param options the options value to set. + * @return the ExportTemplateRequest object itself. + */ + public ExportTemplateRequest withOptions(String options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptions.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptions.java new file mode 100644 index 0000000000000..68f24c8edb2df --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptions.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies whether template expressions are evaluated within the scope of the parent template or nested template. */ +@Fluent +public final class ExpressionEvaluationOptions { + /* + * The scope to be used for evaluation of parameters, variables and functions in a nested template. + */ + @JsonProperty(value = "scope") + private ExpressionEvaluationOptionsScopeType scope; + + /** Creates an instance of ExpressionEvaluationOptions class. */ + public ExpressionEvaluationOptions() { + } + + /** + * Get the scope property: The scope to be used for evaluation of parameters, variables and functions in a nested + * template. + * + * @return the scope value. + */ + public ExpressionEvaluationOptionsScopeType scope() { + return this.scope; + } + + /** + * Set the scope property: The scope to be used for evaluation of parameters, variables and functions in a nested + * template. + * + * @param scope the scope value to set. + * @return the ExpressionEvaluationOptions object itself. + */ + public ExpressionEvaluationOptions withScope(ExpressionEvaluationOptionsScopeType scope) { + this.scope = scope; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptionsScopeType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptionsScopeType.java new file mode 100644 index 0000000000000..a6d1ae3993ec2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExpressionEvaluationOptionsScopeType.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.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The scope to be used for evaluation of parameters, variables and functions in a nested template. */ +public final class ExpressionEvaluationOptionsScopeType + extends ExpandableStringEnum { + /** Static value NotSpecified for ExpressionEvaluationOptionsScopeType. */ + public static final ExpressionEvaluationOptionsScopeType NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Outer for ExpressionEvaluationOptionsScopeType. */ + public static final ExpressionEvaluationOptionsScopeType OUTER = fromString("Outer"); + + /** Static value Inner for ExpressionEvaluationOptionsScopeType. */ + public static final ExpressionEvaluationOptionsScopeType INNER = fromString("Inner"); + + /** + * Creates a new instance of ExpressionEvaluationOptionsScopeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExpressionEvaluationOptionsScopeType() { + } + + /** + * Creates or finds a ExpressionEvaluationOptionsScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExpressionEvaluationOptionsScopeType. + */ + @JsonCreator + public static ExpressionEvaluationOptionsScopeType fromString(String name) { + return fromString(name, ExpressionEvaluationOptionsScopeType.class); + } + + /** + * Gets known ExpressionEvaluationOptionsScopeType values. + * + * @return known ExpressionEvaluationOptionsScopeType values. + */ + public static Collection values() { + return values(ExpressionEvaluationOptionsScopeType.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocation.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocation.java new file mode 100644 index 0000000000000..b2157ee797088 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocation.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource extended location. */ +@Fluent +public final class ExtendedLocation { + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private ExtendedLocationType type; + + /* + * The extended location name. + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of ExtendedLocation class. */ + public ExtendedLocation() { + } + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public ExtendedLocationType type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(ExtendedLocationType type) { + this.type = type; + return this; + } + + /** + * Get the name property: The extended location name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The extended location name. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocationType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocationType.java new file mode 100644 index 0000000000000..bea07979eeb1c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ExtendedLocationType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The extended location type. */ +public final class ExtendedLocationType extends ExpandableStringEnum { + /** Static value EdgeZone for ExtendedLocationType. */ + public static final ExtendedLocationType EDGE_ZONE = fromString("EdgeZone"); + + /** + * Creates a new instance of ExtendedLocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExtendedLocationType() { + } + + /** + * Creates or finds a ExtendedLocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExtendedLocationType. + */ + @JsonCreator + public static ExtendedLocationType fromString(String name) { + return fromString(name, ExtendedLocationType.class); + } + + /** + * Gets known ExtendedLocationType values. + * + * @return known ExtendedLocationType values. + */ + public static Collection values() { + return values(ExtendedLocationType.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResource.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResource.java new file mode 100644 index 0000000000000..758c881154c76 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResource.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner; +import java.util.Map; + +/** An immutable client-side representation of GenericResource. */ +public interface GenericResource { + /** + * 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 plan property: The plan of the resource. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the properties property: The resource properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the kind property: The kind of the resource. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the managedBy property: ID of the resource that manages this resource. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the sku property: The SKU of the resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the extendedLocation property: Resource extended location. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner object. + * + * @return the inner object. + */ + GenericResourceInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResourceExpanded.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResourceExpanded.java new file mode 100644 index 0000000000000..fd427a37e0a98 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/GenericResourceExpanded.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceExpandedInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of GenericResourceExpanded. */ +public interface GenericResourceExpanded { + /** + * 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 plan property: The plan of the resource. + * + * @return the plan value. + */ + Plan plan(); + + /** + * Gets the properties property: The resource properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the kind property: The kind of the resource. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the managedBy property: ID of the resource that manages this resource. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the sku property: The SKU of the resource. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + Identity identity(); + + /** + * Gets the extendedLocation property: Resource extended location. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + + /** + * Gets the createdTime property: The created time of the resource. This is only present if requested via the + * $expand query parameter. + * + * @return the createdTime value. + */ + OffsetDateTime createdTime(); + + /** + * Gets the changedTime property: The changed time of the resource. This is only present if requested via the + * $expand query parameter. + * + * @return the changedTime value. + */ + OffsetDateTime changedTime(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. This is only present if requested + * via the $expand query parameter. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceExpandedInner object. + * + * @return the inner object. + */ + GenericResourceExpandedInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/HttpMessage.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/HttpMessage.java new file mode 100644 index 0000000000000..7177bb072f507 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/HttpMessage.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** HTTP message. */ +@Fluent +public final class HttpMessage { + /* + * HTTP message content. + */ + @JsonProperty(value = "content") + private Object content; + + /** Creates an instance of HttpMessage class. */ + public HttpMessage() { + } + + /** + * Get the content property: HTTP message content. + * + * @return the content value. + */ + public Object content() { + return this.content; + } + + /** + * Set the content property: HTTP message content. + * + * @param content the content value to set. + * @return the HttpMessage object itself. + */ + public HttpMessage withContent(Object content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Identity.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Identity.java new file mode 100644 index 0000000000000..e469e04e68af6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Identity.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public final class Identity { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /* + * The list of user identities associated with the resource. The user identity dictionary key references will be + * ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of Identity class. */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity 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(); + } + }); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/IdentityUserAssignedIdentitiesValue.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/IdentityUserAssignedIdentitiesValue.java new file mode 100644 index 0000000000000..8c2fb8b201783 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/IdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IdentityUserAssignedIdentitiesValue model. */ +@Immutable +public final class IdentityUserAssignedIdentitiesValue { + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** Creates an instance of IdentityUserAssignedIdentitiesValue class. */ + public IdentityUserAssignedIdentitiesValue() { + } + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeployment.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeployment.java new file mode 100644 index 0000000000000..7cef5ca57baba --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeployment.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment on error behavior. */ +@Fluent +public final class OnErrorDeployment { + /* + * The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. + */ + @JsonProperty(value = "type") + private OnErrorDeploymentType type; + + /* + * The deployment to be used on error case. + */ + @JsonProperty(value = "deploymentName") + private String deploymentName; + + /** Creates an instance of OnErrorDeployment class. */ + public OnErrorDeployment() { + } + + /** + * Get the type property: The deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. + * + * @return the type value. + */ + public OnErrorDeploymentType type() { + return this.type; + } + + /** + * Set the type property: The deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. + * + * @param type the type value to set. + * @return the OnErrorDeployment object itself. + */ + public OnErrorDeployment withType(OnErrorDeploymentType type) { + this.type = type; + return this; + } + + /** + * Get the deploymentName property: The deployment to be used on error case. + * + * @return the deploymentName value. + */ + public String deploymentName() { + return this.deploymentName; + } + + /** + * Set the deploymentName property: The deployment to be used on error case. + * + * @param deploymentName the deploymentName value to set. + * @return the OnErrorDeployment object itself. + */ + public OnErrorDeployment withDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentExtended.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentExtended.java new file mode 100644 index 0000000000000..c9691f27d0a9c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentExtended.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment on error behavior with additional details. */ +@Fluent +public final class OnErrorDeploymentExtended { + /* + * The state of the provisioning for the on error deployment. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. + */ + @JsonProperty(value = "type") + private OnErrorDeploymentType type; + + /* + * The deployment to be used on error case. + */ + @JsonProperty(value = "deploymentName") + private String deploymentName; + + /** Creates an instance of OnErrorDeploymentExtended class. */ + public OnErrorDeploymentExtended() { + } + + /** + * Get the provisioningState property: The state of the provisioning for the on error deployment. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the type property: The deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. + * + * @return the type value. + */ + public OnErrorDeploymentType type() { + return this.type; + } + + /** + * Set the type property: The deployment on error behavior type. Possible values are LastSuccessful and + * SpecificDeployment. + * + * @param type the type value to set. + * @return the OnErrorDeploymentExtended object itself. + */ + public OnErrorDeploymentExtended withType(OnErrorDeploymentType type) { + this.type = type; + return this; + } + + /** + * Get the deploymentName property: The deployment to be used on error case. + * + * @return the deploymentName value. + */ + public String deploymentName() { + return this.deploymentName; + } + + /** + * Set the deploymentName property: The deployment to be used on error case. + * + * @param deploymentName the deploymentName value to set. + * @return the OnErrorDeploymentExtended object itself. + */ + public OnErrorDeploymentExtended withDeploymentName(String deploymentName) { + this.deploymentName = deploymentName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentType.java new file mode 100644 index 0000000000000..c26707fc0f08b --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OnErrorDeploymentType.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.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. */ +public enum OnErrorDeploymentType { + /** Enum value LastSuccessful. */ + LAST_SUCCESSFUL("LastSuccessful"), + + /** Enum value SpecificDeployment. */ + SPECIFIC_DEPLOYMENT("SpecificDeployment"); + + /** The actual serialized value for a OnErrorDeploymentType instance. */ + private final String value; + + OnErrorDeploymentType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OnErrorDeploymentType instance. + * + * @param value the serialized value to parse. + * @return the parsed OnErrorDeploymentType object, or null if unable to parse. + */ + @JsonCreator + public static OnErrorDeploymentType fromString(String value) { + if (value == null) { + return null; + } + OnErrorDeploymentType[] items = OnErrorDeploymentType.values(); + for (OnErrorDeploymentType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operation.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operation.java new file mode 100644 index 0000000000000..d12ed35837fb2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operation.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the display property: The object that represents the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationDisplay.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..e2c056e5aeca6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that represents the operation. */ +@Fluent +public final class OperationDisplay { + /* + * Service provider: Microsoft.Resources + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: Service provider: Microsoft.Resources. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Service provider: Microsoft.Resources. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource on which the operation is performed: Profile, endpoint, etc. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Operation type: Read, write, delete, etc. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation type: Read, write, delete, etc. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Description of the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationListResult.java new file mode 100644 index 0000000000000..a6062f6480cbe --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/OperationListResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Result of the request to list Microsoft.Resources operations. It contains a list of operations and a URL link to get + * the next set of results. + */ +@Fluent +public final class OperationListResult { + /* + * List of Microsoft.Resources operations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of Microsoft.Resources operations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Microsoft.Resources operations. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results if there are any. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operations.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operations.java new file mode 100644 index 0000000000000..6443508f6c3f6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list Microsoft.Resources operations as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ParametersLink.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ParametersLink.java new file mode 100644 index 0000000000000..63808a5875ca2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ParametersLink.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Entity representing the reference to the deployment parameters. */ +@Fluent +public final class ParametersLink { + /* + * The URI of the parameters file. + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * If included, must match the ContentVersion in the template. + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /** Creates an instance of ParametersLink class. */ + public ParametersLink() { + } + + /** + * Get the uri property: The URI of the parameters file. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The URI of the parameters file. + * + * @param uri the uri value to set. + * @return the ParametersLink object itself. + */ + public ParametersLink withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the contentVersion property: If included, must match the ContentVersion in the template. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: If included, must match the ContentVersion in the template. + * + * @param contentVersion the contentVersion value to set. + * @return the ParametersLink object itself. + */ + public ParametersLink withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model ParametersLink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ParametersLink.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Permission.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Permission.java new file mode 100644 index 0000000000000..4ea6c95ba1162 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Permission.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role definition permissions. */ +@Fluent +public final class Permission { + /* + * Allowed actions. + */ + @JsonProperty(value = "actions") + private List actions; + + /* + * Denied actions. + */ + @JsonProperty(value = "notActions") + private List notActions; + + /* + * Allowed Data actions. + */ + @JsonProperty(value = "dataActions") + private List dataActions; + + /* + * Denied Data actions. + */ + @JsonProperty(value = "notDataActions") + private List notDataActions; + + /** Creates an instance of Permission class. */ + public Permission() { + } + + /** + * Get the actions property: Allowed actions. + * + * @return the actions value. + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions property: Allowed actions. + * + * @param actions the actions value to set. + * @return the Permission object itself. + */ + public Permission withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the notActions property: Denied actions. + * + * @return the notActions value. + */ + public List notActions() { + return this.notActions; + } + + /** + * Set the notActions property: Denied actions. + * + * @param notActions the notActions value to set. + * @return the Permission object itself. + */ + public Permission withNotActions(List notActions) { + this.notActions = notActions; + return this; + } + + /** + * Get the dataActions property: Allowed Data actions. + * + * @return the dataActions value. + */ + public List dataActions() { + return this.dataActions; + } + + /** + * Set the dataActions property: Allowed Data actions. + * + * @param dataActions the dataActions value to set. + * @return the Permission object itself. + */ + public Permission withDataActions(List dataActions) { + this.dataActions = dataActions; + return this; + } + + /** + * Get the notDataActions property: Denied Data actions. + * + * @return the notDataActions value. + */ + public List notDataActions() { + return this.notDataActions; + } + + /** + * Set the notDataActions property: Denied Data actions. + * + * @param notDataActions the notDataActions value to set. + * @return the Permission object itself. + */ + public Permission withNotDataActions(List notDataActions) { + this.notDataActions = notDataActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Plan.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Plan.java new file mode 100644 index 0000000000000..d9b35ab92c764 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Plan.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Plan for the resource. */ +@Fluent +public final class Plan { + /* + * The plan ID. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The publisher ID. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * The offer ID. + */ + @JsonProperty(value = "product") + private String product; + + /* + * The promotion code. + */ + @JsonProperty(value = "promotionCode") + private String promotionCode; + + /* + * The plan's version. + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of Plan class. */ + public Plan() { + } + + /** + * Get the name property: The plan ID. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The plan ID. + * + * @param name the name value to set. + * @return the Plan object itself. + */ + public Plan withName(String name) { + this.name = name; + return this; + } + + /** + * Get the publisher property: The publisher ID. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher ID. + * + * @param publisher the publisher value to set. + * @return the Plan object itself. + */ + public Plan withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The offer ID. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The offer ID. + * + * @param product the product value to set. + * @return the Plan object itself. + */ + public Plan withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the promotionCode property: The promotion code. + * + * @return the promotionCode value. + */ + public String promotionCode() { + return this.promotionCode; + } + + /** + * Set the promotionCode property: The promotion code. + * + * @param promotionCode the promotionCode value to set. + * @return the Plan object itself. + */ + public Plan withPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** + * Get the version property: The plan's version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The plan's version. + * + * @param version the version value to set. + * @return the Plan object itself. + */ + public Plan withVersion(String version) { + this.version = version; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/PropertyChangeType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/PropertyChangeType.java new file mode 100644 index 0000000000000..6f2ae2bfb3634 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/PropertyChangeType.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The type of property change. */ +public enum PropertyChangeType { + /** Enum value Create. */ + CREATE("Create"), + + /** Enum value Delete. */ + DELETE("Delete"), + + /** Enum value Modify. */ + MODIFY("Modify"), + + /** Enum value Array. */ + ARRAY("Array"), + + /** Enum value NoEffect. */ + NO_EFFECT("NoEffect"); + + /** The actual serialized value for a PropertyChangeType instance. */ + private final String value; + + PropertyChangeType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PropertyChangeType instance. + * + * @param value the serialized value to parse. + * @return the parsed PropertyChangeType object, or null if unable to parse. + */ + @JsonCreator + public static PropertyChangeType fromString(String value) { + if (value == null) { + return null; + } + PropertyChangeType[] items = PropertyChangeType.values(); + for (PropertyChangeType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Provider.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Provider.java new file mode 100644 index 0000000000000..66de8e3309113 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Provider.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import java.util.List; + +/** An immutable client-side representation of Provider. */ +public interface Provider { + /** + * Gets the id property: The provider ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the namespace property: The namespace of the resource provider. + * + * @return the namespace value. + */ + String namespace(); + + /** + * Gets the registrationState property: The registration state of the resource provider. + * + * @return the registrationState value. + */ + String registrationState(); + + /** + * Gets the registrationPolicy property: The registration policy of the resource provider. + * + * @return the registrationPolicy value. + */ + String registrationPolicy(); + + /** + * Gets the resourceTypes property: The collection of provider resource types. + * + * @return the resourceTypes value. + */ + List resourceTypes(); + + /** + * Gets the providerAuthorizationConsentState property: The provider authorization consent state. + * + * @return the providerAuthorizationConsentState value. + */ + ProviderAuthorizationConsentState providerAuthorizationConsentState(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner object. + * + * @return the inner object. + */ + ProviderInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderAuthorizationConsentState.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderAuthorizationConsentState.java new file mode 100644 index 0000000000000..26d57bf33bc2f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderAuthorizationConsentState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provider authorization consent state. */ +public final class ProviderAuthorizationConsentState extends ExpandableStringEnum { + /** Static value NotSpecified for ProviderAuthorizationConsentState. */ + public static final ProviderAuthorizationConsentState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Required for ProviderAuthorizationConsentState. */ + public static final ProviderAuthorizationConsentState REQUIRED = fromString("Required"); + + /** Static value NotRequired for ProviderAuthorizationConsentState. */ + public static final ProviderAuthorizationConsentState NOT_REQUIRED = fromString("NotRequired"); + + /** Static value Consented for ProviderAuthorizationConsentState. */ + public static final ProviderAuthorizationConsentState CONSENTED = fromString("Consented"); + + /** + * Creates a new instance of ProviderAuthorizationConsentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProviderAuthorizationConsentState() { + } + + /** + * Creates or finds a ProviderAuthorizationConsentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProviderAuthorizationConsentState. + */ + @JsonCreator + public static ProviderAuthorizationConsentState fromString(String name) { + return fromString(name, ProviderAuthorizationConsentState.class); + } + + /** + * Gets known ProviderAuthorizationConsentState values. + * + * @return known ProviderAuthorizationConsentState values. + */ + public static Collection values() { + return values(ProviderAuthorizationConsentState.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderConsentDefinition.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderConsentDefinition.java new file mode 100644 index 0000000000000..5056f6bfaa0f1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderConsentDefinition.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The provider consent. */ +@Fluent +public final class ProviderConsentDefinition { + /* + * A value indicating whether authorization is consented or not. + */ + @JsonProperty(value = "consentToAuthorization") + private Boolean consentToAuthorization; + + /** Creates an instance of ProviderConsentDefinition class. */ + public ProviderConsentDefinition() { + } + + /** + * Get the consentToAuthorization property: A value indicating whether authorization is consented or not. + * + * @return the consentToAuthorization value. + */ + public Boolean consentToAuthorization() { + return this.consentToAuthorization; + } + + /** + * Set the consentToAuthorization property: A value indicating whether authorization is consented or not. + * + * @param consentToAuthorization the consentToAuthorization value to set. + * @return the ProviderConsentDefinition object itself. + */ + public ProviderConsentDefinition withConsentToAuthorization(Boolean consentToAuthorization) { + this.consentToAuthorization = consentToAuthorization; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderExtendedLocation.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderExtendedLocation.java new file mode 100644 index 0000000000000..d28498e380956 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderExtendedLocation.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The provider extended location. */ +@Fluent +public final class ProviderExtendedLocation { + /* + * The azure location. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The extended location type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * The extended locations for the azure location. + */ + @JsonProperty(value = "extendedLocations") + private List extendedLocations; + + /** Creates an instance of ProviderExtendedLocation class. */ + public ProviderExtendedLocation() { + } + + /** + * Get the location property: The azure location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The azure location. + * + * @param location the location value to set. + * @return the ProviderExtendedLocation object itself. + */ + public ProviderExtendedLocation withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the type property: The extended location type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The extended location type. + * + * @param type the type value to set. + * @return the ProviderExtendedLocation object itself. + */ + public ProviderExtendedLocation withType(String type) { + this.type = type; + return this; + } + + /** + * Get the extendedLocations property: The extended locations for the azure location. + * + * @return the extendedLocations value. + */ + public List extendedLocations() { + return this.extendedLocations; + } + + /** + * Set the extendedLocations property: The extended locations for the azure location. + * + * @param extendedLocations the extendedLocations value to set. + * @return the ProviderExtendedLocation object itself. + */ + public ProviderExtendedLocation withExtendedLocations(List extendedLocations) { + this.extendedLocations = extendedLocations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderListResult.java new file mode 100644 index 0000000000000..f6ea57013e7ec --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of resource providers. */ +@Fluent +public final class ProviderListResult { + /* + * An array of resource providers. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ProviderListResult class. */ + public ProviderListResult() { + } + + /** + * Get the value property: An array of resource providers. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of resource providers. + * + * @param value the value value to set. + * @return the ProviderListResult object itself. + */ + public ProviderListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermission.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermission.java new file mode 100644 index 0000000000000..5c89ae295a1ac --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermission.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The provider permission. */ +@Fluent +public final class ProviderPermission { + /* + * The application id. + */ + @JsonProperty(value = "applicationId") + private String applicationId; + + /* + * Role definition properties. + */ + @JsonProperty(value = "roleDefinition") + private RoleDefinition roleDefinition; + + /* + * Role definition properties. + */ + @JsonProperty(value = "managedByRoleDefinition") + private RoleDefinition managedByRoleDefinition; + + /* + * The provider authorization consent state. + */ + @JsonProperty(value = "providerAuthorizationConsentState") + private ProviderAuthorizationConsentState providerAuthorizationConsentState; + + /** Creates an instance of ProviderPermission class. */ + public ProviderPermission() { + } + + /** + * Get the applicationId property: The application id. + * + * @return the applicationId value. + */ + public String applicationId() { + return this.applicationId; + } + + /** + * Set the applicationId property: The application id. + * + * @param applicationId the applicationId value to set. + * @return the ProviderPermission object itself. + */ + public ProviderPermission withApplicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * Get the roleDefinition property: Role definition properties. + * + * @return the roleDefinition value. + */ + public RoleDefinition roleDefinition() { + return this.roleDefinition; + } + + /** + * Set the roleDefinition property: Role definition properties. + * + * @param roleDefinition the roleDefinition value to set. + * @return the ProviderPermission object itself. + */ + public ProviderPermission withRoleDefinition(RoleDefinition roleDefinition) { + this.roleDefinition = roleDefinition; + return this; + } + + /** + * Get the managedByRoleDefinition property: Role definition properties. + * + * @return the managedByRoleDefinition value. + */ + public RoleDefinition managedByRoleDefinition() { + return this.managedByRoleDefinition; + } + + /** + * Set the managedByRoleDefinition property: Role definition properties. + * + * @param managedByRoleDefinition the managedByRoleDefinition value to set. + * @return the ProviderPermission object itself. + */ + public ProviderPermission withManagedByRoleDefinition(RoleDefinition managedByRoleDefinition) { + this.managedByRoleDefinition = managedByRoleDefinition; + return this; + } + + /** + * Get the providerAuthorizationConsentState property: The provider authorization consent state. + * + * @return the providerAuthorizationConsentState value. + */ + public ProviderAuthorizationConsentState providerAuthorizationConsentState() { + return this.providerAuthorizationConsentState; + } + + /** + * Set the providerAuthorizationConsentState property: The provider authorization consent state. + * + * @param providerAuthorizationConsentState the providerAuthorizationConsentState value to set. + * @return the ProviderPermission object itself. + */ + public ProviderPermission withProviderAuthorizationConsentState( + ProviderAuthorizationConsentState providerAuthorizationConsentState) { + this.providerAuthorizationConsentState = providerAuthorizationConsentState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (roleDefinition() != null) { + roleDefinition().validate(); + } + if (managedByRoleDefinition() != null) { + managedByRoleDefinition().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermissionListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermissionListResult.java new file mode 100644 index 0000000000000..4b04b5a5c6d44 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderPermissionListResult.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderPermissionListResultInner; +import java.util.List; + +/** An immutable client-side representation of ProviderPermissionListResult. */ +public interface ProviderPermissionListResult { + /** + * Gets the value property: An array of provider permissions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.ProviderPermissionListResultInner + * object. + * + * @return the inner object. + */ + ProviderPermissionListResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderRegistrationRequest.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderRegistrationRequest.java new file mode 100644 index 0000000000000..d769c2bd352c7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderRegistrationRequest.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The provider registration definition. */ +@Fluent +public final class ProviderRegistrationRequest { + /* + * The provider consent. + */ + @JsonProperty(value = "thirdPartyProviderConsent") + private ProviderConsentDefinition thirdPartyProviderConsent; + + /** Creates an instance of ProviderRegistrationRequest class. */ + public ProviderRegistrationRequest() { + } + + /** + * Get the thirdPartyProviderConsent property: The provider consent. + * + * @return the thirdPartyProviderConsent value. + */ + public ProviderConsentDefinition thirdPartyProviderConsent() { + return this.thirdPartyProviderConsent; + } + + /** + * Set the thirdPartyProviderConsent property: The provider consent. + * + * @param thirdPartyProviderConsent the thirdPartyProviderConsent value to set. + * @return the ProviderRegistrationRequest object itself. + */ + public ProviderRegistrationRequest withThirdPartyProviderConsent( + ProviderConsentDefinition thirdPartyProviderConsent) { + this.thirdPartyProviderConsent = thirdPartyProviderConsent; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (thirdPartyProviderConsent() != null) { + thirdPartyProviderConsent().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceType.java new file mode 100644 index 0000000000000..ae3a9210a053a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceType.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Resource type managed by the resource provider. */ +@Fluent +public final class ProviderResourceType { + /* + * The resource type. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * The collection of locations where this resource type can be created. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * The location mappings that are supported by this resource type. + */ + @JsonProperty(value = "locationMappings") + private List locationMappings; + + /* + * The aliases that are supported by this resource type. + */ + @JsonProperty(value = "aliases") + private List aliases; + + /* + * The API version. + */ + @JsonProperty(value = "apiVersions") + private List apiVersions; + + /* + * The default API version. + */ + @JsonProperty(value = "defaultApiVersion", access = JsonProperty.Access.WRITE_ONLY) + private String defaultApiVersion; + + /* + * The zoneMappings property. + */ + @JsonProperty(value = "zoneMappings") + private List zoneMappings; + + /* + * The API profiles for the resource provider. + */ + @JsonProperty(value = "apiProfiles", access = JsonProperty.Access.WRITE_ONLY) + private List apiProfiles; + + /* + * The additional capabilities offered by this resource type. + */ + @JsonProperty(value = "capabilities") + private String capabilities; + + /* + * The properties. + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /** Creates an instance of ProviderResourceType class. */ + public ProviderResourceType() { + } + + /** + * Get the resourceType property: The resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The resource type. + * + * @param resourceType the resourceType value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the locations property: The collection of locations where this resource type can be created. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: The collection of locations where this resource type can be created. + * + * @param locations the locations value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the locationMappings property: The location mappings that are supported by this resource type. + * + * @return the locationMappings value. + */ + public List locationMappings() { + return this.locationMappings; + } + + /** + * Set the locationMappings property: The location mappings that are supported by this resource type. + * + * @param locationMappings the locationMappings value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withLocationMappings(List locationMappings) { + this.locationMappings = locationMappings; + return this; + } + + /** + * Get the aliases property: The aliases that are supported by this resource type. + * + * @return the aliases value. + */ + public List aliases() { + return this.aliases; + } + + /** + * Set the aliases property: The aliases that are supported by this resource type. + * + * @param aliases the aliases value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withAliases(List aliases) { + this.aliases = aliases; + return this; + } + + /** + * Get the apiVersions property: The API version. + * + * @return the apiVersions value. + */ + public List apiVersions() { + return this.apiVersions; + } + + /** + * Set the apiVersions property: The API version. + * + * @param apiVersions the apiVersions value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withApiVersions(List apiVersions) { + this.apiVersions = apiVersions; + return this; + } + + /** + * Get the defaultApiVersion property: The default API version. + * + * @return the defaultApiVersion value. + */ + public String defaultApiVersion() { + return this.defaultApiVersion; + } + + /** + * Get the zoneMappings property: The zoneMappings property. + * + * @return the zoneMappings value. + */ + public List zoneMappings() { + return this.zoneMappings; + } + + /** + * Set the zoneMappings property: The zoneMappings property. + * + * @param zoneMappings the zoneMappings value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withZoneMappings(List zoneMappings) { + this.zoneMappings = zoneMappings; + return this; + } + + /** + * Get the apiProfiles property: The API profiles for the resource provider. + * + * @return the apiProfiles value. + */ + public List apiProfiles() { + return this.apiProfiles; + } + + /** + * Get the capabilities property: The additional capabilities offered by this resource type. + * + * @return the capabilities value. + */ + public String capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: The additional capabilities offered by this resource type. + * + * @param capabilities the capabilities value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withCapabilities(String capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Get the properties property: The properties. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: The properties. + * + * @param properties the properties value to set. + * @return the ProviderResourceType object itself. + */ + public ProviderResourceType withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (locationMappings() != null) { + locationMappings().forEach(e -> e.validate()); + } + if (aliases() != null) { + aliases().forEach(e -> e.validate()); + } + if (zoneMappings() != null) { + zoneMappings().forEach(e -> e.validate()); + } + if (apiProfiles() != null) { + apiProfiles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypeListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypeListResult.java new file mode 100644 index 0000000000000..bd6e67ab69575 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypeListResult.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.ProviderResourceTypeListResultInner; +import java.util.List; + +/** An immutable client-side representation of ProviderResourceTypeListResult. */ +public interface ProviderResourceTypeListResult { + /** + * Gets the value property: An array of resource types. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The URL to use for getting the next set of results. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.ProviderResourceTypeListResultInner + * object. + * + * @return the inner object. + */ + ProviderResourceTypeListResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypes.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypes.java new file mode 100644 index 0000000000000..28d1dee7a1652 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProviderResourceTypes.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.resources.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ProviderResourceTypes. */ +public interface ProviderResourceTypes { + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider along with {@link Response}. + */ + Response listWithResponse( + String resourceProviderNamespace, String expand, Context context); + + /** + * List the resource types for a specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of resource types of a resource provider. + */ + ProviderResourceTypeListResult list(String resourceProviderNamespace); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Providers.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Providers.java new file mode 100644 index 0000000000000..7d81fdf71a2dc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Providers.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.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 Providers. */ +public interface Providers { + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response}. + */ + Response unregisterWithResponse(String resourceProviderNamespace, Context context); + + /** + * Unregisters a subscription from a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to unregister. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information. + */ + Provider unregister(String resourceProviderNamespace); + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group 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 registerAtManagementGroupScopeWithResponse( + String resourceProviderNamespace, String groupId, Context context); + + /** + * Registers a management group with a resource provider. Use this operation to register a resource provider with + * resource types that can be deployed at the management group scope. It does not recursively register subscriptions + * within the management group. Instead, you must register subscriptions individually. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param groupId The management group 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 registerAtManagementGroupScope(String resourceProviderNamespace, String groupId); + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource 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 the provider permissions along with {@link Response}. + */ + Response providerPermissionsWithResponse( + String resourceProviderNamespace, Context context); + + /** + * Get the provider permissions. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the provider permissions. + */ + ProviderPermissionListResult providerPermissions(String resourceProviderNamespace); + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @param properties The third party consent for S2S. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information along with {@link Response}. + */ + Response registerWithResponse( + String resourceProviderNamespace, ProviderRegistrationRequest properties, Context context); + + /** + * Registers a subscription with a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider to register. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource provider information. + */ + Provider register(String resourceProviderNamespace); + + /** + * Gets all resource providers for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all resource providers for a subscription. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String expand, Context context); + + /** + * Gets all resource providers for the tenant. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtTenantScope(); + + /** + * Gets all resource providers for the tenant. + * + * @param expand The properties to include in the results. For example, use &$expand=metadata in the query + * string to retrieve resource provider metadata. To include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all resource providers for the tenant as paginated response with {@link PagedIterable}. + */ + PagedIterable listAtTenantScope(String expand, Context context); + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider along with {@link Response}. + */ + Response getWithResponse(String resourceProviderNamespace, String expand, Context context); + + /** + * Gets the specified resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider. + */ + Provider get(String resourceProviderNamespace); + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @param expand The $expand query parameter. For example, to include property aliases in response, use + * $expand=resourceTypes/aliases. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level along with {@link Response}. + */ + Response getAtTenantScopeWithResponse(String resourceProviderNamespace, String expand, Context context); + + /** + * Gets the specified resource provider at the tenant level. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified resource provider at the tenant level. + */ + Provider getAtTenantScope(String resourceProviderNamespace); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningOperation.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningOperation.java new file mode 100644 index 0000000000000..4a4fa8877f2bc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningOperation.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The name of the current provisioning operation. */ +public enum ProvisioningOperation { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value Create. */ + CREATE("Create"), + + /** Enum value Delete. */ + DELETE("Delete"), + + /** Enum value Waiting. */ + WAITING("Waiting"), + + /** Enum value AzureAsyncOperationWaiting. */ + AZURE_ASYNC_OPERATION_WAITING("AzureAsyncOperationWaiting"), + + /** Enum value ResourceCacheWaiting. */ + RESOURCE_CACHE_WAITING("ResourceCacheWaiting"), + + /** Enum value Action. */ + ACTION("Action"), + + /** Enum value Read. */ + READ("Read"), + + /** Enum value EvaluateDeploymentOutput. */ + EVALUATE_DEPLOYMENT_OUTPUT("EvaluateDeploymentOutput"), + + /** Enum value DeploymentCleanup. */ + DEPLOYMENT_CLEANUP("DeploymentCleanup"); + + /** The actual serialized value for a ProvisioningOperation instance. */ + private final String value; + + ProvisioningOperation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningOperation instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningOperation object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningOperation fromString(String value) { + if (value == null) { + return null; + } + ProvisioningOperation[] items = ProvisioningOperation.values(); + for (ProvisioningOperation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningState.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..de88085b5a6e7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ProvisioningState.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Denotes the state of provisioning. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value NotSpecified for ProvisioningState. */ + public static final ProvisioningState NOT_SPECIFIED = fromString("NotSpecified"); + + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Ready for ProvisioningState. */ + public static final ProvisioningState READY = fromString("Ready"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Created for ProvisioningState. */ + public static final ProvisioningState CREATED = fromString("Created"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Deleted for ProvisioningState. */ + public static final ProvisioningState DELETED = fromString("Deleted"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * 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. + */ + @JsonCreator + 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/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroup.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroup.java new file mode 100644 index 0000000000000..49e145e042343 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroup.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner; +import java.util.Map; + +/** An immutable client-side representation of ResourceGroup. */ +public interface ResourceGroup { + /** + * 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 group properties. + * + * @return the properties value. + */ + ResourceGroupProperties properties(); + + /** + * Gets the managedBy property: The ID of the resource that manages this resource group. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner object. + * + * @return the inner object. + */ + ResourceGroupInner innerModel(); + + /** The entirety of the ResourceGroup definition. */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + /** The ResourceGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the ResourceGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ResourceGroup 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. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + /** + * The stage of the ResourceGroup 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.WithManagedBy { + /** + * Executes the create request. + * + * @return the created resource. + */ + ResourceGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ResourceGroup create(Context context); + } + /** The stage of the ResourceGroup 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 ResourceGroup definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The resource group properties.. + * + * @param properties The resource group properties. + * @return the next definition stage. + */ + WithCreate withProperties(ResourceGroupProperties properties); + } + /** The stage of the ResourceGroup definition allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: The ID of the resource that manages this resource group.. + * + * @param managedBy The ID of the resource that manages this resource group. + * @return the next definition stage. + */ + WithCreate withManagedBy(String managedBy); + } + } + /** + * Begins update for the ResourceGroup resource. + * + * @return the stage of resource update. + */ + ResourceGroup.Update update(); + + /** The template for ResourceGroup update. */ + interface Update + extends UpdateStages.WithTags, UpdateStages.WithName, UpdateStages.WithProperties, UpdateStages.WithManagedBy { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ResourceGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ResourceGroup apply(Context context); + } + /** The ResourceGroup update stages. */ + interface UpdateStages { + /** The stage of the ResourceGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: The tags attached to the resource group.. + * + * @param tags The tags attached to the resource group. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the ResourceGroup update allowing to specify name. */ + interface WithName { + /** + * Specifies the name property: The name of the resource group.. + * + * @param name The name of the resource group. + * @return the next definition stage. + */ + Update withName(String name); + } + /** The stage of the ResourceGroup update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The resource group properties.. + * + * @param properties The resource group properties. + * @return the next definition stage. + */ + Update withProperties(ResourceGroupProperties properties); + } + /** The stage of the ResourceGroup update allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: The ID of the resource that manages this resource group.. + * + * @param managedBy The ID of the resource that manages this resource group. + * @return the next definition stage. + */ + Update withManagedBy(String managedBy); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ResourceGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ResourceGroup refresh(Context context); + + /** + * Captures the specified resource group as a template. + * + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + ResourceGroupExportResult exportTemplate(ExportTemplateRequest parameters); + + /** + * Captures the specified resource group as a template. + * + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + ResourceGroupExportResult exportTemplate(ExportTemplateRequest parameters, Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupExportResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupExportResult.java new file mode 100644 index 0000000000000..954fbc4cd5a6a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupExportResult.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupExportResultInner; + +/** An immutable client-side representation of ResourceGroupExportResult. */ +public interface ResourceGroupExportResult { + /** + * Gets the template property: The template content. + * + * @return the template value. + */ + Object template(); + + /** + * Gets the error property: Error Response + * + *

The template export error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupExportResultInner object. + * + * @return the inner object. + */ + ResourceGroupExportResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupListResult.java new file mode 100644 index 0000000000000..45f12c7341d3e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.ResourceGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of resource groups. */ +@Fluent +public final class ResourceGroupListResult { + /* + * An array of resource groups. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ResourceGroupListResult class. */ + public ResourceGroupListResult() { + } + + /** + * Get the value property: An array of resource groups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of resource groups. + * + * @param value the value value to set. + * @return the ResourceGroupListResult object itself. + */ + public ResourceGroupListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupPatchable.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupPatchable.java new file mode 100644 index 0000000000000..2f6600f482479 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupPatchable.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Resource group information. */ +@Fluent +public final class ResourceGroupPatchable { + /* + * The name of the resource group. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource group properties. + */ + @JsonProperty(value = "properties") + private ResourceGroupProperties properties; + + /* + * The ID of the resource that manages this resource group. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + + /* + * The tags attached to the resource group. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ResourceGroupPatchable class. */ + public ResourceGroupPatchable() { + } + + /** + * Get the name property: The name of the resource group. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource group. + * + * @param name the name value to set. + * @return the ResourceGroupPatchable object itself. + */ + public ResourceGroupPatchable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: The resource group properties. + * + * @return the properties value. + */ + public ResourceGroupProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource group properties. + * + * @param properties the properties value to set. + * @return the ResourceGroupPatchable object itself. + */ + public ResourceGroupPatchable withProperties(ResourceGroupProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the managedBy property: The ID of the resource that manages this resource group. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: The ID of the resource that manages this resource group. + * + * @param managedBy the managedBy value to set. + * @return the ResourceGroupPatchable object itself. + */ + public ResourceGroupPatchable withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get the tags property: The tags attached to the resource group. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags attached to the resource group. + * + * @param tags the tags value to set. + * @return the ResourceGroupPatchable object itself. + */ + public ResourceGroupPatchable withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupProperties.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupProperties.java new file mode 100644 index 0000000000000..bad2fd2c453bc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroupProperties.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource group properties. */ +@Immutable +public final class ResourceGroupProperties { + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** Creates an instance of ResourceGroupProperties class. */ + public ResourceGroupProperties() { + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroups.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroups.java new file mode 100644 index 0000000000000..0d4341a19865f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceGroups.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.resources.generated.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 ResourceGroups. */ +public interface ResourceGroups { + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists along with {@link Response}. + */ + Response checkExistenceWithResponse(String resourceGroupName, Context context); + + /** + * Checks whether a resource group exists. + * + * @param resourceGroupName The name of the resource group to check. 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 whether resource exists. + */ + boolean checkExistence(String resourceGroupName); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. 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. + */ + void deleteByResourceGroup(String resourceGroupName); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param resourceGroupName The name of the resource group to delete. The name is case insensitive. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 forceDeletionTypes, Context context); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, Context context); + + /** + * Gets a resource group. + * + * @param resourceGroupName The name of the resource group to get. 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 a resource group. + */ + ResourceGroup get(String resourceGroupName); + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + ResourceGroupExportResult exportTemplate(String resourceGroupName, ExportTemplateRequest parameters); + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parameters Parameters for exporting the template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource group export result. + */ + ResourceGroupExportResult exportTemplate( + String resourceGroupName, ExportTemplateRequest parameters, Context context); + + /** + * Gets all the resource groups for a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all the resource groups for a subscription. + * + * @param filter The filter to apply on the operation.<br><br>You can filter by tag names and values. + * For example, to filter for a tag name and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. + * @param top The number of results to return. If null is passed, returns all resource groups. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resource groups for a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Integer top, Context context); + + /** + * Gets a resource group. + * + * @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 resource group along with {@link Response}. + */ + ResourceGroup getById(String id); + + /** + * Gets a resource group. + * + * @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 resource group along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @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 resource group. + * + *

When you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes all + * of its template deployments and currently stored operations. + * + * @param id the resource ID. + * @param forceDeletionTypes The resource types you want to force delete. Currently, only the following is + * supported: forceDeletionTypes=Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, String forceDeletionTypes, Context context); + + /** + * Begins definition for a new ResourceGroup resource. + * + * @param name resource name. + * @return the first stage of the new ResourceGroup definition. + */ + ResourceGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceIdentityType.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..0f65d67299980 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceIdentityType.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.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The identity type. */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + if (value == null) { + return null; + } + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceListResult.java new file mode 100644 index 0000000000000..53cd5e9ae7aff --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceExpandedInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of resource groups. */ +@Fluent +public final class ResourceListResult { + /* + * An array of resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ResourceListResult class. */ + public ResourceListResult() { + } + + /** + * Get the value property: An array of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of resources. + * + * @param value the value value to set. + * @return the ResourceListResult object itself. + */ + public ResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceReference.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceReference.java new file mode 100644 index 0000000000000..4f4f2c53d4c3d --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourceReference.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource Id model. */ +@Immutable +public final class ResourceReference { + /* + * The fully qualified resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of ResourceReference class. */ + public ResourceReference() { + } + + /** + * Get the id property: The fully qualified resource Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Resources.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Resources.java new file mode 100644 index 0000000000000..289723df6b411 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Resources.java @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.GenericResourceInner; + +/** Resource collection API of Resources. */ +public interface Resources { + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the resources for a resource group. + * + * @param resourceGroupName The resource group with the resources to get. + * @param filter The filter to apply on the operation.<br><br>The properties you can use for eq (equals) + * or ne (not equals) are: location, resourceType, name, resourceGroup, identity, identity/principalId, plan, + * plan/publisher, plan/product, plan/name, plan/version, and plan/promotionCode.<br><br>For + * example, to filter by a resource type, use: $filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'<br><br>You can use substringof(value, property) in the + * filter. The properties you can use for substring are: name and resourceGroup.<br><br>For example, + * to get all resources with 'demo' anywhere in the name, use: $filter=substringof('demo', + * name)<br><br>You can link more than one substringof together by adding and/or + * operators.<br><br>You can filter by tag names and values. For example, to filter for a tag name + * and value, use $filter=tagName eq 'tag1' and tagValue eq 'Value1'. When you filter by a tag name and value, + * the tags for each resource are not returned in the results.<br><br>You can use some properties + * together when filtering. The combinations you can use are: substringof and/or resourceType, plan and + * plan/publisher and plan/name, identity and identity/principalId. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of results to return. If null is passed, returns all resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources for a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, String expand, Integer top, Context context); + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); + + /** + * Moves resources from one resource group to another resource group. + * + *

The resources to be moved must be in the same source resource group in the source subscription being used. The + * target resource group may be in a different subscription. When moving resources, both the source group and the + * target group are locked for the duration of the operation. Write and delete operations are blocked on the groups + * until the move completes. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be moved. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters); + + /** + * Validates whether resources can be moved from one resource group to another resource group. + * + *

This operation checks whether the specified resources can be moved to the target. The resources to be moved + * must be in the same source resource group in the source subscription being used. The target resource group may be + * in a different subscription. If validation succeeds, it returns HTTP response code 204 (no content). If + * validation fails, it returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the + * Location header value to check the result of the long-running operation. + * + * @param sourceResourceGroupName The name of the resource group from the source subscription containing the + * resources to be validated for move. + * @param parameters Parameters for moving resources. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 validateMoveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context); + + /** + * Get all the resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get all the resources in a subscription. + * + * @param filter The filter to apply on the operation.<br><br>Filter comparison operators include `eq` + * (equals) and `ne` (not equals) and may be used with the following properties: `location`, `resourceType`, + * `name`, `resourceGroup`, `identity`, `identity/principalId`, `plan`, `plan/publisher`, `plan/product`, + * `plan/name`, `plan/version`, and `plan/promotionCode`.<br><br>For example, to filter by a + * resource type, use `$filter=resourceType eq + * 'Microsoft.Network/virtualNetworks'`<br><br><br>`substringof(value, property)` can be used + * to filter for substrings of the following currently-supported properties: `name` and + * `resourceGroup`<br><br>For example, to get all resources with 'demo' anywhere in the resource + * name, use `$filter=substringof('demo', name)`<br><br>Multiple substring operations can also be + * combined using `and`/`or` operators.<br><br>Note that any truncated number of results queried via + * `$top` may also not be compatible when using a filter.<br><br><br>Resources can be filtered + * by tag names and values. For example, to filter for a tag name and value, use `$filter=tagName eq 'tag1' and + * tagValue eq 'Value1'`. Note that when resources are filtered by tag name and value, <b>the original + * tags for each resource will not be returned in the results.</b> Any list of additional properties + * queried via `$expand` may also not be compatible when filtering by tag names/values. <br><br>For + * tag names only, resources can be filtered by prefix using the following syntax: `$filter=startswith(tagName, + * 'depart')`. This query will return all resources with a tag name prefixed by the phrase `depart` + * (i.e.`department`, `departureDate`, `departureTime`, etc.)<br><br><br>Note that some + * properties can be combined when filtering resources, which include the following: `substringof() and/or + * resourceType`, `plan and plan/publisher and plan/name`, and `identity and identity/principalId`. + * @param expand Comma-separated list of additional properties to be included in the response. Valid values include + * `createdTime`, `changedTime` and `provisioningState`. For example, `$expand=createdTime,changedTime`. + * @param top The number of recommendations per page if a paged version of this API is being used. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all the resources in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, String expand, Integer top, Context context); + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Checks whether a resource exists. + * + * @param resourceGroupName The name of the resource group containing the resource to check. The name is case + * insensitive. + * @param resourceProviderNamespace The resource provider of the resource to check. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to check whether it exists. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistence( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Deletes a resource. + * + * @param resourceGroupName The name of the resource group that contains the resource to delete. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type. + * @param resourceName The name of the resource to delete. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information. + */ + GenericResource createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters); + + /** + * Creates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to create. + * @param resourceName The name of the resource to create. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for creating or updating the 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 resource information. + */ + GenericResource createOrUpdate( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context); + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information. + */ + GenericResource update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters); + + /** + * Updates a resource. + * + * @param resourceGroupName The name of the resource group for the resource. The name is case insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource to update. + * @param resourceName The name of the resource to update. + * @param apiVersion The API version to use for the operation. + * @param parameters Parameters for updating the 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 resource information. + */ + GenericResource update( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + GenericResourceInner parameters, + Context context); + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion, + Context context); + + /** + * Gets a resource. + * + * @param resourceGroupName The name of the resource group containing the resource to get. The name is case + * insensitive. + * @param resourceProviderNamespace The namespace of the resource provider. + * @param parentResourcePath The parent resource identity. + * @param resourceType The resource type of the resource. + * @param resourceName The name of the resource to get. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource. + */ + GenericResource get( + String resourceGroupName, + String resourceProviderNamespace, + String parentResourcePath, + String resourceType, + String resourceName, + String apiVersion); + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + Response checkExistenceByIdWithResponse(String resourceId, String apiVersion, Context context); + + /** + * Checks by ID whether a resource exists. This API currently works only for a limited set of Resource providers. In + * the event that a Resource provider does not implement this API, ARM will respond with a 405. The alternative then + * is to use the GET API to check for the existence of the resource. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + boolean checkExistenceById(String resourceId, String apiVersion); + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceId, String apiVersion); + + /** + * Deletes a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceId, String apiVersion, Context context); + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + GenericResource createOrUpdateById(String resourceId, String apiVersion, GenericResourceInner parameters); + + /** + * Create a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Create or update resource 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 resource information. + */ + GenericResource createOrUpdateById( + String resourceId, String apiVersion, GenericResourceInner parameters, Context context); + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + GenericResource updateById(String resourceId, String apiVersion, GenericResourceInner parameters); + + /** + * Updates a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param parameters Update resource 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 resource information. + */ + GenericResource updateById(String resourceId, String apiVersion, GenericResourceInner parameters, Context context); + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource by ID along with {@link Response}. + */ + Response getByIdWithResponse(String resourceId, String apiVersion, Context context); + + /** + * Gets a resource by ID. + * + * @param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the + * format, + * /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}. + * @param apiVersion The API version to use for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource by ID. + */ + GenericResource getById(String resourceId, String apiVersion); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourcesMoveInfo.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourcesMoveInfo.java new file mode 100644 index 0000000000000..dbed7a2a0a7d2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ResourcesMoveInfo.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Parameters of move resources. */ +@Fluent +public final class ResourcesMoveInfo { + /* + * The IDs of the resources. + */ + @JsonProperty(value = "resources") + private List resources; + + /* + * The target resource group. + */ + @JsonProperty(value = "targetResourceGroup") + private String targetResourceGroup; + + /** Creates an instance of ResourcesMoveInfo class. */ + public ResourcesMoveInfo() { + } + + /** + * Get the resources property: The IDs of the resources. + * + * @return the resources value. + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources property: The IDs of the resources. + * + * @param resources the resources value to set. + * @return the ResourcesMoveInfo object itself. + */ + public ResourcesMoveInfo withResources(List resources) { + this.resources = resources; + return this; + } + + /** + * Get the targetResourceGroup property: The target resource group. + * + * @return the targetResourceGroup value. + */ + public String targetResourceGroup() { + return this.targetResourceGroup; + } + + /** + * Set the targetResourceGroup property: The target resource group. + * + * @param targetResourceGroup the targetResourceGroup value to set. + * @return the ResourcesMoveInfo object itself. + */ + public ResourcesMoveInfo withTargetResourceGroup(String targetResourceGroup) { + this.targetResourceGroup = targetResourceGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/RoleDefinition.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/RoleDefinition.java new file mode 100644 index 0000000000000..cf480791b1ba2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/RoleDefinition.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Role definition properties. */ +@Fluent +public final class RoleDefinition { + /* + * The role definition ID. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The role definition name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * If this is a service role. + */ + @JsonProperty(value = "isServiceRole") + private Boolean isServiceRole; + + /* + * Role definition permissions. + */ + @JsonProperty(value = "permissions") + private List permissions; + + /* + * Role definition assignable scopes. + */ + @JsonProperty(value = "scopes") + private List scopes; + + /** Creates an instance of RoleDefinition class. */ + public RoleDefinition() { + } + + /** + * Get the id property: The role definition ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The role definition ID. + * + * @param id the id value to set. + * @return the RoleDefinition object itself. + */ + public RoleDefinition withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The role definition name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The role definition name. + * + * @param name the name value to set. + * @return the RoleDefinition object itself. + */ + public RoleDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isServiceRole property: If this is a service role. + * + * @return the isServiceRole value. + */ + public Boolean isServiceRole() { + return this.isServiceRole; + } + + /** + * Set the isServiceRole property: If this is a service role. + * + * @param isServiceRole the isServiceRole value to set. + * @return the RoleDefinition object itself. + */ + public RoleDefinition withIsServiceRole(Boolean isServiceRole) { + this.isServiceRole = isServiceRole; + return this; + } + + /** + * Get the permissions property: Role definition permissions. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: Role definition permissions. + * + * @param permissions the permissions value to set. + * @return the RoleDefinition object itself. + */ + public RoleDefinition withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Get the scopes property: Role definition assignable scopes. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: Role definition assignable scopes. + * + * @param scopes the scopes value to set. + * @return the RoleDefinition object itself. + */ + public RoleDefinition withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeployment.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeployment.java new file mode 100644 index 0000000000000..7726fd3b2c28e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeployment.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Deployment operation parameters. */ +@Fluent +public final class ScopedDeployment { + /* + * The location to store the deployment data. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The deployment properties. + */ + @JsonProperty(value = "properties", required = true) + private DeploymentProperties properties; + + /* + * Deployment tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ScopedDeployment class. */ + public ScopedDeployment() { + } + + /** + * Get the location property: The location to store the deployment data. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location to store the deployment data. + * + * @param location the location value to set. + * @return the ScopedDeployment object itself. + */ + public ScopedDeployment withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: The deployment properties. + * + * @return the properties value. + */ + public DeploymentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The deployment properties. + * + * @param properties the properties value to set. + * @return the ScopedDeployment object itself. + */ + public ScopedDeployment withProperties(DeploymentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags property: Deployment tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Deployment tags. + * + * @param tags the tags value to set. + * @return the ScopedDeployment object itself. + */ + public ScopedDeployment withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model ScopedDeployment")); + } + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property properties in model ScopedDeployment")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScopedDeployment.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeploymentWhatIf.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeploymentWhatIf.java new file mode 100644 index 0000000000000..2037fe0299f4e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ScopedDeploymentWhatIf.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment What-if operation parameters. */ +@Fluent +public final class ScopedDeploymentWhatIf { + /* + * The location to store the deployment data. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /* + * The deployment properties. + */ + @JsonProperty(value = "properties", required = true) + private DeploymentWhatIfProperties properties; + + /** Creates an instance of ScopedDeploymentWhatIf class. */ + public ScopedDeploymentWhatIf() { + } + + /** + * Get the location property: The location to store the deployment data. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location to store the deployment data. + * + * @param location the location value to set. + * @return the ScopedDeploymentWhatIf object itself. + */ + public ScopedDeploymentWhatIf withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the properties property: The deployment properties. + * + * @return the properties value. + */ + public DeploymentWhatIfProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The deployment properties. + * + * @param properties the properties value to set. + * @return the ScopedDeploymentWhatIf object itself. + */ + public ScopedDeploymentWhatIf withProperties(DeploymentWhatIfProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (location() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property location in model ScopedDeploymentWhatIf")); + } + if (properties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model ScopedDeploymentWhatIf")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ScopedDeploymentWhatIf.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Sku.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Sku.java new file mode 100644 index 0000000000000..dcbc906bca914 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Sku.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SKU for the resource. */ +@Fluent +public final class Sku { + /* + * The SKU name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The SKU tier. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The SKU size. + */ + @JsonProperty(value = "size") + private String size; + + /* + * The SKU family. + */ + @JsonProperty(value = "family") + private String family; + + /* + * The SKU model. + */ + @JsonProperty(value = "model") + private String model; + + /* + * The SKU capacity. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * Get the name property: The SKU name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The SKU name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The SKU tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The SKU tier. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: The SKU size. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: The SKU size. + * + * @param size the size value to set. + * @return the Sku object itself. + */ + public Sku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: The SKU family. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: The SKU family. + * + * @param family the family value to set. + * @return the Sku object itself. + */ + public Sku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the model property: The SKU model. + * + * @return the model value. + */ + public String model() { + return this.model; + } + + /** + * Set the model property: The SKU model. + * + * @param model the model value to set. + * @return the Sku object itself. + */ + public Sku withModel(String model) { + this.model = model; + return this; + } + + /** + * Get the capacity property: The SKU capacity. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: The SKU capacity. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/StatusMessage.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/StatusMessage.java new file mode 100644 index 0000000000000..78274ca21c376 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/StatusMessage.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation status message object. */ +@Fluent +public final class StatusMessage { + /* + * Status of the deployment operation. + */ + @JsonProperty(value = "status") + private String status; + + /* + * Error Response + * + * The error reported by the operation. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of StatusMessage class. */ + public StatusMessage() { + } + + /** + * Get the status property: Status of the deployment operation. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Status of the deployment operation. + * + * @param status the status value to set. + * @return the StatusMessage object itself. + */ + public StatusMessage withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the error property: Error Response + * + *

The error reported by the operation. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: Error Response + * + *

The error reported by the operation. + * + * @param error the error value to set. + * @return the StatusMessage object itself. + */ + public StatusMessage withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagCount.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagCount.java new file mode 100644 index 0000000000000..73f8481c4a8ba --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagCount.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Tag count. */ +@Fluent +public final class TagCount { + /* + * Type of count. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Value of count. + */ + @JsonProperty(value = "value") + private Integer value; + + /** Creates an instance of TagCount class. */ + public TagCount() { + } + + /** + * Get the type property: Type of count. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of count. + * + * @param type the type value to set. + * @return the TagCount object itself. + */ + public TagCount withType(String type) { + this.type = type; + return this; + } + + /** + * Get the value property: Value of count. + * + * @return the value value. + */ + public Integer value() { + return this.value; + } + + /** + * Set the value property: Value of count. + * + * @param value the value value to set. + * @return the TagCount object itself. + */ + public TagCount withValue(Integer value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagDetails.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagDetails.java new file mode 100644 index 0000000000000..6b4d229a7af79 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagDetails.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagDetailsInner; +import java.util.List; + +/** An immutable client-side representation of TagDetails. */ +public interface TagDetails { + /** + * Gets the id property: The tag name ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the tagName property: The tag name. + * + * @return the tagName value. + */ + String tagName(); + + /** + * Gets the count property: The total number of resources that use the resource tag. When a tag is initially created + * and has no associated resources, the value is 0. + * + * @return the count value. + */ + TagCount count(); + + /** + * Gets the values property: The list of tag values. + * + * @return the values value. + */ + List values(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.TagDetailsInner object. + * + * @return the inner object. + */ + TagDetailsInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagOperations.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagOperations.java new file mode 100644 index 0000000000000..19b22dc23bf00 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagOperations.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.resources.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; + +/** Resource collection API of TagOperations. */ +public interface TagOperations { + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 deleteValueWithResponse(String tagName, String tagValue, Context context); + + /** + * Deletes a predefined tag value for a predefined tag name. + * + *

This operation allows deleting a value from the list of predefined values for an existing predefined tag name. + * The value being deleted must not be in use as a tag value for the given tag name for any resource. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteValue(String tagName, String tagValue); + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information along with {@link Response}. + */ + Response createOrUpdateValueWithResponse(String tagName, String tagValue, Context context); + + /** + * Creates a predefined value for a predefined tag name. + * + *

This operation allows adding a value to the list of predefined values for an existing predefined tag name. A + * tag value can have a maximum of 256 characters. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag information. + */ + TagValue createOrUpdateValue(String tagName, String tagValue); + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details along with {@link Response}. + */ + Response createOrUpdateWithResponse(String tagName, Context context); + + /** + * Creates a predefined tag name. + * + *

This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name + * can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which + * are reserved for Azure use: 'microsoft', 'azure', 'windows'. + * + * @param tagName The name of the tag to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tag details. + */ + TagDetails createOrUpdate(String tagName); + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 tagName, Context context); + + /** + * Deletes a predefined tag name. + * + *

This operation allows deleting a name from the list of predefined tag names for the given subscription. The + * name being deleted must not be in use as a tag name for any resource. All predefined values for the given name + * must have already been deleted. + * + * @param tagName The name of the tag. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 tagName); + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a summary of tag usage under the subscription. + * + *

This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, + * and returns a summary of usage for each tag name and value under the given subscription. In case of a large + * number of tags, this operation may return a previously cached result. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of subscription tags as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + TagsResource createOrUpdateAtScope(String scope, TagsResourceInner parameters); + + /** + * Creates or updates the entire set of tags on a resource or subscription. + * + *

This operation allows adding or replacing the entire set of tags on the specified resource or subscription. + * The specified entity can have a maximum of 50 tags. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags API requests and responses. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + TagsResource createOrUpdateAtScope(String scope, TagsResourceInner parameters, Context context); + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + TagsResource updateAtScope(String scope, TagsPatchResource parameters); + + /** + * Selectively updates the set of tags on a resource or subscription. + * + *

This operation allows replacing, merging or selectively deleting tags on the specified resource or + * subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' + * option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new + * names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags + * based on given names or name/value pairs. + * + * @param scope The resource scope. + * @param parameters Wrapper resource for tags patch API request only. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return wrapper resource for tags API requests and responses. + */ + TagsResource updateAtScope(String scope, TagsPatchResource parameters, Context context); + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription along with {@link Response}. + */ + Response getAtScopeWithResponse(String scope, Context context); + + /** + * Gets the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the entire set of tags on a resource or subscription. + */ + TagsResource getAtScope(String scope); + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope); + + /** + * Deletes the entire set of tags on a resource or subscription. + * + * @param scope The resource scope. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 deleteAtScope(String scope, Context context); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagValue.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagValue.java new file mode 100644 index 0000000000000..81313ba483c65 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagValue.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner; + +/** An immutable client-side representation of TagValue. */ +public interface TagValue { + /** + * Gets the id property: The tag value ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the tagValue property: The tag value. + * + * @return the tagValue value. + */ + String tagValue(); + + /** + * Gets the count property: The tag value count. + * + * @return the count value. + */ + TagCount count(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.TagValueInner object. + * + * @return the inner object. + */ + TagValueInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Tags.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Tags.java new file mode 100644 index 0000000000000..e862f923aad4f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/Tags.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A dictionary of name and value pairs. */ +@Fluent +public final class Tags { + /* + * Dictionary of + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of Tags class. */ + public Tags() { + } + + /** + * Get the tags property: Dictionary of <string>. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Dictionary of <string>. + * + * @param tags the tags value to set. + * @return the Tags object itself. + */ + public Tags withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsListResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsListResult.java new file mode 100644 index 0000000000000..70a14ad46748c --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.resources.generated.fluent.models.TagDetailsInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of subscription tags. */ +@Fluent +public final class TagsListResult { + /* + * An array of tags. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of TagsListResult class. */ + public TagsListResult() { + } + + /** + * Get the value property: An array of tags. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of tags. + * + * @param value the value value to set. + * @return the TagsListResult object itself. + */ + public TagsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to use for getting the next set of results. + * + * @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()); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchOperation.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchOperation.java new file mode 100644 index 0000000000000..8e5394fcd85a1 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchOperation.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.resources.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The operation type for the patch API. */ +public final class TagsPatchOperation extends ExpandableStringEnum { + /** Static value Replace for TagsPatchOperation. */ + public static final TagsPatchOperation REPLACE = fromString("Replace"); + + /** Static value Merge for TagsPatchOperation. */ + public static final TagsPatchOperation MERGE = fromString("Merge"); + + /** Static value Delete for TagsPatchOperation. */ + public static final TagsPatchOperation DELETE = fromString("Delete"); + + /** + * Creates a new instance of TagsPatchOperation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TagsPatchOperation() { + } + + /** + * Creates or finds a TagsPatchOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding TagsPatchOperation. + */ + @JsonCreator + public static TagsPatchOperation fromString(String name) { + return fromString(name, TagsPatchOperation.class); + } + + /** + * Gets known TagsPatchOperation values. + * + * @return known TagsPatchOperation values. + */ + public static Collection values() { + return values(TagsPatchOperation.class); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchResource.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchResource.java new file mode 100644 index 0000000000000..5bac916960abf --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsPatchResource.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Wrapper resource for tags patch API request only. */ +@Fluent +public final class TagsPatchResource { + /* + * The operation type for the patch API. + */ + @JsonProperty(value = "operation") + private TagsPatchOperation operation; + + /* + * The set of tags. + */ + @JsonProperty(value = "properties") + private Tags properties; + + /** Creates an instance of TagsPatchResource class. */ + public TagsPatchResource() { + } + + /** + * Get the operation property: The operation type for the patch API. + * + * @return the operation value. + */ + public TagsPatchOperation operation() { + return this.operation; + } + + /** + * Set the operation property: The operation type for the patch API. + * + * @param operation the operation value to set. + * @return the TagsPatchResource object itself. + */ + public TagsPatchResource withOperation(TagsPatchOperation operation) { + this.operation = operation; + return this; + } + + /** + * Get the properties property: The set of tags. + * + * @return the properties value. + */ + public Tags properties() { + return this.properties; + } + + /** + * Set the properties property: The set of tags. + * + * @param properties the properties value to set. + * @return the TagsPatchResource object itself. + */ + public TagsPatchResource withProperties(Tags properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsResource.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsResource.java new file mode 100644 index 0000000000000..1c96fa3652bc5 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TagsResource.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; + +/** An immutable client-side representation of TagsResource. */ +public interface TagsResource { + /** + * 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 set of tags. + * + * @return the properties value. + */ + Tags properties(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner object. + * + * @return the inner object. + */ + TagsResourceInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TargetResource.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TargetResource.java new file mode 100644 index 0000000000000..38c9be9a10f94 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TargetResource.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Target resource. */ +@Fluent +public final class TargetResource { + /* + * The ID of the resource. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The name of the resource. + */ + @JsonProperty(value = "resourceName") + private String resourceName; + + /* + * The type of the resource. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /** Creates an instance of TargetResource class. */ + public TargetResource() { + } + + /** + * Get the id property: The ID of the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The ID of the resource. + * + * @param id the id value to set. + * @return the TargetResource object itself. + */ + public TargetResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourceName property: The name of the resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The name of the resource. + * + * @param resourceName the resourceName value to set. + * @return the TargetResource object itself. + */ + public TargetResource withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the resourceType property: The type of the resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: The type of the resource. + * + * @param resourceType the resourceType value to set. + * @return the TargetResource object itself. + */ + public TargetResource withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateHashResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateHashResult.java new file mode 100644 index 0000000000000..5261962f31c74 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateHashResult.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.resources.generated.models; + +import com.azure.resourcemanager.resources.generated.fluent.models.TemplateHashResultInner; + +/** An immutable client-side representation of TemplateHashResult. */ +public interface TemplateHashResult { + /** + * Gets the minifiedTemplate property: The minified template string. + * + * @return the minifiedTemplate value. + */ + String minifiedTemplate(); + + /** + * Gets the templateHash property: The template hash. + * + * @return the templateHash value. + */ + String templateHash(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.TemplateHashResultInner object. + * + * @return the inner object. + */ + TemplateHashResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateLink.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateLink.java new file mode 100644 index 0000000000000..f324126ef12aa --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/TemplateLink.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Entity representing the reference to the template. */ +@Fluent +public final class TemplateLink { + /* + * The URI of the template to deploy. Use either the uri or id property, but not both. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * The resource id of a Template Spec. Use either the id or uri property, but not both. + */ + @JsonProperty(value = "id") + private String id; + + /* + * The relativePath property can be used to deploy a linked template at a location relative to the parent. If the + * parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the + * parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * If included, must match the ContentVersion in the template. + */ + @JsonProperty(value = "contentVersion") + private String contentVersion; + + /* + * The query string (for example, a SAS token) to be used with the templateLink URI. + */ + @JsonProperty(value = "queryString") + private String queryString; + + /** Creates an instance of TemplateLink class. */ + public TemplateLink() { + } + + /** + * Get the uri property: The URI of the template to deploy. Use either the uri or id property, but not both. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The URI of the template to deploy. Use either the uri or id property, but not both. + * + * @param uri the uri value to set. + * @return the TemplateLink object itself. + */ + public TemplateLink withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the id property: The resource id of a Template Spec. Use either the id or uri property, but not both. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The resource id of a Template Spec. Use either the id or uri property, but not both. + * + * @param id the id value to set. + * @return the TemplateLink object itself. + */ + public TemplateLink withId(String id) { + this.id = id; + return this; + } + + /** + * Get the relativePath property: The relativePath property can be used to deploy a linked template at a location + * relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in + * the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent + * and relativePath URIs. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: The relativePath property can be used to deploy a linked template at a location + * relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in + * the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent + * and relativePath URIs. + * + * @param relativePath the relativePath value to set. + * @return the TemplateLink object itself. + */ + public TemplateLink withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the contentVersion property: If included, must match the ContentVersion in the template. + * + * @return the contentVersion value. + */ + public String contentVersion() { + return this.contentVersion; + } + + /** + * Set the contentVersion property: If included, must match the ContentVersion in the template. + * + * @param contentVersion the contentVersion value to set. + * @return the TemplateLink object itself. + */ + public TemplateLink withContentVersion(String contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * Get the queryString property: The query string (for example, a SAS token) to be used with the templateLink URI. + * + * @return the queryString value. + */ + public String queryString() { + return this.queryString; + } + + /** + * Set the queryString property: The query string (for example, a SAS token) to be used with the templateLink URI. + * + * @param queryString the queryString value to set. + * @return the TemplateLink object itself. + */ + public TemplateLink withQueryString(String queryString) { + this.queryString = queryString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfChange.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfChange.java new file mode 100644 index 0000000000000..09ce9b66e5835 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfChange.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about a single resource change predicted by What-If operation. */ +@Fluent +public final class WhatIfChange { + /* + * Resource ID + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * Type of change that will be made to the resource when the deployment is executed. + */ + @JsonProperty(value = "changeType", required = true) + private ChangeType changeType; + + /* + * The explanation about why the resource is unsupported by What-If. + */ + @JsonProperty(value = "unsupportedReason") + private String unsupportedReason; + + /* + * The snapshot of the resource before the deployment is executed. + */ + @JsonProperty(value = "before") + private Object before; + + /* + * The predicted snapshot of the resource after the deployment is executed. + */ + @JsonProperty(value = "after") + private Object after; + + /* + * The predicted changes to resource properties. + */ + @JsonProperty(value = "delta") + private List delta; + + /** Creates an instance of WhatIfChange class. */ + public WhatIfChange() { + } + + /** + * Get the resourceId property: Resource ID. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID. + * + * @param resourceId the resourceId value to set. + * @return the WhatIfChange object itself. + */ + public WhatIfChange withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the changeType property: Type of change that will be made to the resource when the deployment is executed. + * + * @return the changeType value. + */ + public ChangeType changeType() { + return this.changeType; + } + + /** + * Set the changeType property: Type of change that will be made to the resource when the deployment is executed. + * + * @param changeType the changeType value to set. + * @return the WhatIfChange object itself. + */ + public WhatIfChange withChangeType(ChangeType changeType) { + this.changeType = changeType; + return this; + } + + /** + * Get the unsupportedReason property: The explanation about why the resource is unsupported by What-If. + * + * @return the unsupportedReason value. + */ + public String unsupportedReason() { + return this.unsupportedReason; + } + + /** + * Set the unsupportedReason property: The explanation about why the resource is unsupported by What-If. + * + * @param unsupportedReason the unsupportedReason value to set. + * @return the WhatIfChange object itself. + */ + public WhatIfChange withUnsupportedReason(String unsupportedReason) { + this.unsupportedReason = unsupportedReason; + return this; + } + + /** + * Get the before property: The snapshot of the resource before the deployment is executed. + * + * @return the before value. + */ + public Object before() { + return this.before; + } + + /** + * Set the before property: The snapshot of the resource before the deployment is executed. + * + * @param before the before value to set. + * @return the WhatIfChange object itself. + */ + public WhatIfChange withBefore(Object before) { + this.before = before; + return this; + } + + /** + * Get the after property: The predicted snapshot of the resource after the deployment is executed. + * + * @return the after value. + */ + public Object after() { + return this.after; + } + + /** + * Set the after property: The predicted snapshot of the resource after the deployment is executed. + * + * @param after the after value to set. + * @return the WhatIfChange object itself. + */ + public WhatIfChange withAfter(Object after) { + this.after = after; + return this; + } + + /** + * Get the delta property: The predicted changes to resource properties. + * + * @return the delta value. + */ + public List delta() { + return this.delta; + } + + /** + * Set the delta property: The predicted changes to resource properties. + * + * @param delta the delta value to set. + * @return the WhatIfChange object itself. + */ + public WhatIfChange withDelta(List delta) { + this.delta = delta; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model WhatIfChange")); + } + if (changeType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property changeType in model WhatIfChange")); + } + if (delta() != null) { + delta().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WhatIfChange.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfOperationResult.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfOperationResult.java new file mode 100644 index 0000000000000..17ad5554349a6 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfOperationResult.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.resources.generated.fluent.models.WhatIfOperationResultInner; +import java.util.List; + +/** An immutable client-side representation of WhatIfOperationResult. */ +public interface WhatIfOperationResult { + /** + * Gets the status property: Status of the What-If operation. + * + * @return the status value. + */ + String status(); + + /** + * Gets the error property: Error Response + * + *

Error when What-If operation fails. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the changes property: List of resource changes predicted by What-If operation. + * + * @return the changes value. + */ + List changes(); + + /** + * Gets the inner com.azure.resourcemanager.resources.generated.fluent.models.WhatIfOperationResultInner object. + * + * @return the inner object. + */ + WhatIfOperationResultInner innerModel(); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfPropertyChange.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfPropertyChange.java new file mode 100644 index 0000000000000..07cc3a9726c97 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfPropertyChange.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.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The predicted change to the resource property. */ +@Fluent +public final class WhatIfPropertyChange { + /* + * The path of the property. + */ + @JsonProperty(value = "path", required = true) + private String path; + + /* + * The type of property change. + */ + @JsonProperty(value = "propertyChangeType", required = true) + private PropertyChangeType propertyChangeType; + + /* + * The value of the property before the deployment is executed. + */ + @JsonProperty(value = "before") + private Object before; + + /* + * The value of the property after the deployment is executed. + */ + @JsonProperty(value = "after") + private Object after; + + /* + * Nested property changes. + */ + @JsonProperty(value = "children") + private List children; + + /** Creates an instance of WhatIfPropertyChange class. */ + public WhatIfPropertyChange() { + } + + /** + * Get the path property: The path of the property. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path of the property. + * + * @param path the path value to set. + * @return the WhatIfPropertyChange object itself. + */ + public WhatIfPropertyChange withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the propertyChangeType property: The type of property change. + * + * @return the propertyChangeType value. + */ + public PropertyChangeType propertyChangeType() { + return this.propertyChangeType; + } + + /** + * Set the propertyChangeType property: The type of property change. + * + * @param propertyChangeType the propertyChangeType value to set. + * @return the WhatIfPropertyChange object itself. + */ + public WhatIfPropertyChange withPropertyChangeType(PropertyChangeType propertyChangeType) { + this.propertyChangeType = propertyChangeType; + return this; + } + + /** + * Get the before property: The value of the property before the deployment is executed. + * + * @return the before value. + */ + public Object before() { + return this.before; + } + + /** + * Set the before property: The value of the property before the deployment is executed. + * + * @param before the before value to set. + * @return the WhatIfPropertyChange object itself. + */ + public WhatIfPropertyChange withBefore(Object before) { + this.before = before; + return this; + } + + /** + * Get the after property: The value of the property after the deployment is executed. + * + * @return the after value. + */ + public Object after() { + return this.after; + } + + /** + * Set the after property: The value of the property after the deployment is executed. + * + * @param after the after value to set. + * @return the WhatIfPropertyChange object itself. + */ + public WhatIfPropertyChange withAfter(Object after) { + this.after = after; + return this; + } + + /** + * Get the children property: Nested property changes. + * + * @return the children value. + */ + public List children() { + return this.children; + } + + /** + * Set the children property: Nested property changes. + * + * @param children the children value to set. + * @return the WhatIfPropertyChange object itself. + */ + public WhatIfPropertyChange withChildren(List children) { + this.children = children; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property path in model WhatIfPropertyChange")); + } + if (propertyChangeType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property propertyChangeType in model WhatIfPropertyChange")); + } + if (children() != null) { + children().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WhatIfPropertyChange.class); +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfResultFormat.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfResultFormat.java new file mode 100644 index 0000000000000..d24f99911e6c7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/WhatIfResultFormat.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.resources.generated.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** The format of the What-If results. */ +public enum WhatIfResultFormat { + /** Enum value ResourceIdOnly. */ + RESOURCE_ID_ONLY("ResourceIdOnly"), + + /** Enum value FullResourcePayloads. */ + FULL_RESOURCE_PAYLOADS("FullResourcePayloads"); + + /** The actual serialized value for a WhatIfResultFormat instance. */ + private final String value; + + WhatIfResultFormat(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WhatIfResultFormat instance. + * + * @param value the serialized value to parse. + * @return the parsed WhatIfResultFormat object, or null if unable to parse. + */ + @JsonCreator + public static WhatIfResultFormat fromString(String value) { + if (value == null) { + return null; + } + WhatIfResultFormat[] items = WhatIfResultFormat.values(); + for (WhatIfResultFormat item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** {@inheritDoc} */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ZoneMapping.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ZoneMapping.java new file mode 100644 index 0000000000000..6256b142fd709 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/ZoneMapping.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ZoneMapping model. */ +@Fluent +public final class ZoneMapping { + /* + * The location of the zone mapping. + */ + @JsonProperty(value = "location") + private String location; + + /* + * The zones property. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of ZoneMapping class. */ + public ZoneMapping() { + } + + /** + * Get the location property: The location of the zone mapping. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the zone mapping. + * + * @param location the location value to set. + * @return the ZoneMapping object itself. + */ + public ZoneMapping withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: The zones property. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: The zones property. + * + * @param zones the zones value to set. + * @return the ZoneMapping object itself. + */ + public ZoneMapping withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/package-info.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/models/package-info.java new file mode 100644 index 0000000000000..14abe5e913b4f --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/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 ResourceManagementClient. Provides operations for working with resources and + * resource groups. + */ +package com.azure.resourcemanager.resources.generated.models; diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/package-info.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/package-info.java new file mode 100644 index 0000000000000..f8ac6598c8b7e --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/com/azure/resourcemanager/resources/generated/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 ResourceManagementClient. Provides operations for working with resources and + * resource groups. + */ +package com.azure.resourcemanager.resources.generated; diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/module-info.java b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..e8dcb7edb80c0 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.resources.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.resources.generated; + exports com.azure.resourcemanager.resources.generated.fluent; + exports com.azure.resourcemanager.resources.generated.fluent.models; + exports com.azure.resourcemanager.resources.generated.models; + + opens com.azure.resourcemanager.resources.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.resources.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCalculateTemplateHashSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCalculateTemplateHashSamples.java new file mode 100644 index 0000000000000..999049cce533a --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCalculateTemplateHashSamples.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.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; + +/** Samples for Deployments CalculateTemplateHash. */ +public final class DeploymentsCalculateTemplateHashSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/CalculateTemplateHash.json + */ + /** + * Sample code: Calculate template hash. + * + * @param manager Entry point to ResourceManager. + */ + public static void calculateTemplateHash(com.azure.resourcemanager.resources.generated.ResourceManager manager) + throws IOException { + manager + .deployments() + .calculateTemplateHashWithResponse( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize( + "{\"$schema\":\"http://schemas.management.azure.com/deploymentTemplate?api-version=2014-04-01-preview\",\"contentVersion\":\"1.0.0.0\",\"outputs\":{\"string\":{\"type\":\"string\",\"value\":\"myvalue\"}},\"parameters\":{\"string\":{\"type\":\"string\"}},\"resources\":[],\"variables\":{\"array\":[1,2,3,4],\"bool\":true,\"int\":42,\"object\":{\"object\":{\"location\":\"West" + + " US\",\"vmSize\":\"Large\"}},\"string\":\"string\"}}", + Object.class, + SerializerEncoding.JSON), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java new file mode 100644 index 0000000000000..0d8a10b921099 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtManagementGroupScopeSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments CreateOrUpdateAtManagementGroupScope. */ +public final class DeploymentsCreateOrUpdateAtManagementGroupScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtManagementGroup.json + */ + /** + * Sample code: Create deployment at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtManagementGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtManagementGroupScope( + "my-management-group-id", + "my-deployment", + new ScopedDeployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtScopeSamples.java new file mode 100644 index 0000000000000..aebd9b6f9efdb --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtScopeSamples.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.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Deployments CreateOrUpdateAtScope. */ +public final class DeploymentsCreateOrUpdateAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtScope.json + */ + /** + * Sample code: Create deployment at a given scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtAGivenScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtScope( + "providers/Microsoft.Management/managementGroups/my-management-group-id", + "my-deployment", + new Deployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.java new file mode 100644 index 0000000000000..31623a4c7d0f7 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtSubscriptionScopeSamples.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.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.Deployment; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments CreateOrUpdateAtSubscriptionScope. */ +public final class DeploymentsCreateOrUpdateAtSubscriptionScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentSubscriptionTemplateSpecsWithId.json + */ + /** + * Sample code: Create a deployment that will deploy a templateSpec with the given resourceId. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtSubscriptionScope( + "my-deployment", + new Deployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink( + new TemplateLink() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.java new file mode 100644 index 0000000000000..9ae25dae95a72 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateAtTenantScopeSamples.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.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeployment; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Deployments CreateOrUpdateAtTenantScope. */ +public final class DeploymentsCreateOrUpdateAtTenantScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentAtTenant.json + */ + /** + * Sample code: Create deployment at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void createDeploymentAtTenantScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .createOrUpdateAtTenantScope( + "tenant-dep01", + new ScopedDeployment() + .withLocation("eastus") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2")), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..fab339465fd40 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsCreateOrUpdateSamples.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentProperties; +import com.azure.resourcemanager.resources.generated.models.OnErrorDeployment; +import com.azure.resourcemanager.resources.generated.models.OnErrorDeploymentType; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments CreateOrUpdate. */ +public final class DeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentResourceGroup.json + */ + /** + * Sample code: Create a deployment that will deploy a template with a uri and queryString. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateWithAUriAndQueryString( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink( + new TemplateLink() + .withUri("https://example.com/exampleTemplate.json") + .withQueryString( + "sv=2019-02-02&st=2019-04-29T22%3A18%3A26Z&se=2019-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=xxxxxxxx0xxxxxxxxxxxxx%2bxxxxxxxxxxxxxxxxxxxx%3d")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .create(); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentResourceGroupTemplateSpecsWithId.json + */ + /** + * Sample code: Create a deployment that will deploy a templateSpec with the given resourceId. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillDeployATemplateSpecWithTheGivenResourceId( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink( + new TemplateLink() + .withId( + "/subscriptions/00000000-0000-0000-0000-000000000001/resourceGroups/my-resource-group/providers/Microsoft.Resources/TemplateSpecs/TemplateSpec-Name/versions/v1")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)) + .create(); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentWithOnErrorDeploymentSpecificDeployment.json + */ + /** + * Sample code: Create a deployment that will redeploy another deployment on failure. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillRedeployAnotherDeploymentOnFailure( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.COMPLETE) + .withOnErrorDeployment( + new OnErrorDeployment() + .withType(OnErrorDeploymentType.SPECIFIC_DEPLOYMENT) + .withDeploymentName("name-of-deployment-to-use"))) + .create(); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutDeploymentWithOnErrorDeploymentLastSuccessful.json + */ + /** + * Sample code: Create a deployment that will redeploy the last successful deployment on failure. + * + * @param manager Entry point to ResourceManager. + */ + public static void createADeploymentThatWillRedeployTheLastSuccessfulDeploymentOnFailure( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .define("my-deployment") + .withExistingResourceGroup("my-resource-group") + .withProperties( + new DeploymentProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.COMPLETE) + .withOnErrorDeployment(new OnErrorDeployment().withType(OnErrorDeploymentType.LAST_SUCCESSFUL))) + .create(); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java new file mode 100644 index 0000000000000..3c315e150e777 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtManagementGroupScopeSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIfAtManagementGroupScope. */ +public final class DeploymentsWhatIfAtManagementGroupScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnManagementGroup.json + */ + /** + * Sample code: Predict template changes at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtManagementGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIfAtManagementGroupScope( + "myManagementGruop", + "exampleDeploymentName", + new ScopedDeploymentWhatIf() + .withLocation("eastus") + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java new file mode 100644 index 0000000000000..821f9753683a8 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtSubscriptionScopeSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIfAtSubscriptionScope. */ +public final class DeploymentsWhatIfAtSubscriptionScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnSubscription.json + */ + /** + * Sample code: Predict template changes at subscription scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtSubscriptionScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIfAtSubscriptionScope( + "my-deployment", + new DeploymentWhatIf() + .withLocation("westus") + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtTenantScopeSamples.java new file mode 100644 index 0000000000000..9d4ea375c79c2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfAtTenantScopeSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.ScopedDeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIfAtTenantScope. */ +public final class DeploymentsWhatIfAtTenantScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnTenant.json + */ + /** + * Sample code: Predict template changes at management group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtManagementGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIfAtTenantScope( + "exampleDeploymentName", + new ScopedDeploymentWhatIf() + .withLocation("eastus") + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfSamples.java new file mode 100644 index 0000000000000..7fb0f1f6c8c17 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/DeploymentsWhatIfSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.resources.generated.models.DeploymentMode; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIf; +import com.azure.resourcemanager.resources.generated.models.DeploymentWhatIfProperties; +import com.azure.resourcemanager.resources.generated.models.TemplateLink; +import java.io.IOException; + +/** Samples for Deployments WhatIf. */ +public final class DeploymentsWhatIfSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PostDeploymentWhatIfOnResourceGroup.json + */ + /** + * Sample code: Predict template changes at resource group scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void predictTemplateChangesAtResourceGroupScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) throws IOException { + manager + .deployments() + .whatIf( + "my-resource-group", + "my-deployment", + new DeploymentWhatIf() + .withProperties( + new DeploymentWhatIfProperties() + .withTemplateLink(new TemplateLink().withUri("https://example.com/exampleTemplate.json")) + .withParameters( + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("{}", Object.class, SerializerEncoding.JSON)) + .withMode(DeploymentMode.INCREMENTAL)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProviderResourceTypesListSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProviderResourceTypesListSamples.java new file mode 100644 index 0000000000000..6d5674f84ddcf --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProviderResourceTypesListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for ProviderResourceTypes List. */ +public final class ProviderResourceTypesListSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProviderResourceTypes.json + */ + /** + * Sample code: Get provider resource types. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviderResourceTypes(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providerResourceTypes().listWithResponse("Microsoft.TestRP", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetAtTenantScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetAtTenantScopeSamples.java new file mode 100644 index 0000000000000..a8c170b0c7a70 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetAtTenantScopeSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for Providers GetAtTenantScope. */ +public final class ProvidersGetAtTenantScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetNamedProviderAtTenant.json + */ + /** + * Sample code: Get a resource provider at tenant scope. + * + * @param manager Entry point to ResourceManager. + */ + public static void getAResourceProviderAtTenantScope( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .providers() + .getAtTenantScopeWithResponse( + "Microsoft.Storage", "resourceTypes/aliases", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetSamples.java new file mode 100644 index 0000000000000..18d060198afcb --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for Providers Get. */ +public final class ProvidersGetSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProvider.json + */ + /** + * Sample code: Get provider. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProvider(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providers().getWithResponse("Microsoft.TestRP1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersListSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersListSamples.java new file mode 100644 index 0000000000000..4007196a8a2b2 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for Providers List. */ +public final class ProvidersListSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProviders.json + */ + /** + * Sample code: Get providers. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviders(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providers().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersProviderPermissionsSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersProviderPermissionsSamples.java new file mode 100644 index 0000000000000..507e164dd8a11 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ProvidersProviderPermissionsSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for Providers ProviderPermissions. */ +public final class ProvidersProviderPermissionsSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetProviderPermissions.json + */ + /** + * Sample code: Get provider resource types. + * + * @param manager Entry point to ResourceManager. + */ + public static void getProviderResourceTypes(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.providers().providerPermissionsWithResponse("Microsoft.TestRP", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsCreateOrUpdateSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2eb533c12ef58 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsCreateOrUpdateSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for ResourceGroups CreateOrUpdate. */ +public final class ResourceGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/CreateResourceGroup.json + */ + /** + * Sample code: Create or update a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void createOrUpdateAResourceGroup( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager.resourceGroups().define("my-resource-group").withRegion("eastus").create(); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsDeleteSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsDeleteSamples.java new file mode 100644 index 0000000000000..92eb73322b834 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsDeleteSamples.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.resources.generated.generated; + +/** Samples for ResourceGroups Delete. */ +public final class ResourceGroupsDeleteSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ForceDeleteVMsInResourceGroup.json + */ + /** + * Sample code: Force delete all the Virtual Machines in a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void forceDeleteAllTheVirtualMachinesInAResourceGroup( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .delete("my-resource-group", "Microsoft.Compute/virtualMachines", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ForceDeleteVMsAndVMSSInResourceGroup.json + */ + /** + * Sample code: Force delete all the Virtual Machines and Virtual Machine Scale Sets in a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void forceDeleteAllTheVirtualMachinesAndVirtualMachineScaleSetsInAResourceGroup( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .delete( + "my-resource-group", + "Microsoft.Compute/virtualMachines,Microsoft.Compute/virtualMachineScaleSets", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsExportTemplateSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsExportTemplateSamples.java new file mode 100644 index 0000000000000..110f6146cfd64 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/ResourceGroupsExportTemplateSamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.resourcemanager.resources.generated.models.ExportTemplateRequest; +import java.util.Arrays; + +/** Samples for ResourceGroups ExportTemplate. */ +public final class ResourceGroupsExportTemplateSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ExportResourceGroup.json + */ + /** + * Sample code: Export a resource group. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroup(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .exportTemplate( + "my-resource-group", + new ExportTemplateRequest() + .withResources(Arrays.asList("*")) + .withOptions("IncludeParameterDefaultValue,IncludeComments"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/ExportResourceGroupWithFiltering.json + */ + /** + * Sample code: Export a resource group with filtering. + * + * @param manager Entry point to ResourceManager. + */ + public static void exportAResourceGroupWithFiltering( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .resourceGroups() + .exportTemplate( + "my-resource-group", + new ExportTemplateRequest() + .withResources( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-resource-group/providers/My.RP/myResourceType/myFirstResource")) + .withOptions("SkipResourceNameParameterization"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsCreateOrUpdateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsCreateOrUpdateAtScopeSamples.java new file mode 100644 index 0000000000000..0122db5169805 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsCreateOrUpdateAtScopeSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.resourcemanager.resources.generated.fluent.models.TagsResourceInner; +import com.azure.resourcemanager.resources.generated.models.Tags; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TagOperations CreateOrUpdateAtScope. */ +public final class TagOperationsCreateOrUpdateAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .createOrUpdateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + new TagsResourceInner() + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PutTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .createOrUpdateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000", + new TagsResourceInner() + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsDeleteAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsDeleteAtScopeSamples.java new file mode 100644 index 0000000000000..7255c3c87cfdc --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsDeleteAtScopeSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for TagOperations DeleteAtScope. */ +public final class TagOperationsDeleteAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/DeleteTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .deleteAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/DeleteTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .deleteAtScope("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsGetAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsGetAtScopeSamples.java new file mode 100644 index 0000000000000..5bc557a866339 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsGetAtScopeSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +/** Samples for TagOperations GetAtScope. */ +public final class TagOperationsGetAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetTagsResource.json + */ + /** + * Sample code: Get tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void getTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .getAtScopeWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/GetTagsSubscription.json + */ + /** + * Sample code: Get tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void getTagsOnASubscription(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .getAtScopeWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsUpdateAtScopeSamples.java b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsUpdateAtScopeSamples.java new file mode 100644 index 0000000000000..b4beaf003ff14 --- /dev/null +++ b/sdk/resources/azure-resourcemanager-resources-generated/src/samples/java/com/azure/resourcemanager/resources/generated/generated/TagOperationsUpdateAtScopeSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.resources.generated.generated; + +import com.azure.resourcemanager.resources.generated.models.Tags; +import com.azure.resourcemanager.resources.generated.models.TagsPatchOperation; +import com.azure.resourcemanager.resources.generated.models.TagsPatchResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for TagOperations UpdateAtScope. */ +public final class TagOperationsUpdateAtScopeSamples { + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PatchTagsResource.json + */ + /** + * Sample code: Update tags on a resource. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnAResource(com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .updateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/my-resource-group/providers/myPRNameSpace/VM/myVm", + new TagsPatchResource() + .withOperation(TagsPatchOperation.REPLACE) + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/examples/PatchTagsSubscription.json + */ + /** + * Sample code: Update tags on a subscription. + * + * @param manager Entry point to ResourceManager. + */ + public static void updateTagsOnASubscription( + com.azure.resourcemanager.resources.generated.ResourceManager manager) { + manager + .tagOperations() + .updateAtScope( + "subscriptions/00000000-0000-0000-0000-000000000000", + new TagsPatchResource() + .withOperation(TagsPatchOperation.REPLACE) + .withProperties(new Tags().withTags(mapOf("tagKey1", "tag-value-1", "tagKey2", "tag-value-2"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/resources/ci.yml b/sdk/resources/ci.yml new file mode 100644 index 0000000000000..add89996b3bc1 --- /dev/null +++ b/sdk/resources/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.yml + - sdk/resources/azure-resourcemanager-resources-generated/ + exclude: + - sdk/resources/pom.xml + - sdk/resources/azure-resourcemanager-resources-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.yml + - sdk/resources/azure-resourcemanager-resources-generated/ + exclude: + - sdk/resources/pom.xml + - sdk/resources/azure-resourcemanager-resources-generated/pom.xml + +parameters: + - name: release_azureresourcemanagerresourcesgenerated + displayName: azure-resourcemanager-resources-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: resources + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-resources-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerresourcesgenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerresourcesgenerated }} diff --git a/sdk/resources/pom.xml b/sdk/resources/pom.xml new file mode 100644 index 0000000000000..e4a9d5c7f7bb5 --- /dev/null +++ b/sdk/resources/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-resources-service + pom + 1.0.0 + + + azure-resourcemanager-resources-generated + +