From 5247bc7705024633a9483e31faa603a3879991c6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 12 Apr 2022 17:45:35 +0000 Subject: [PATCH] CodeGen from PR 18148 in Azure/azure-rest-api-specs Merge 7a4dc211a95160cb75535918fee1292e9df10f19 into f560f78c86eaf6dfdee064d3a36d0a12c653efa0 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 102 ++ .../SAMPLE.md | 766 ++++++++ .../azure-resourcemanager-elasticsan/pom.xml | 55 + .../elasticsan/ElasticSanManager.java | 326 ++++ .../fluent/ElasticSanManagement.java | 81 + .../elasticsan/fluent/ElasticSansClient.java | 285 +++ .../elasticsan/fluent/OperationsClient.java | 36 + .../elasticsan/fluent/SkusClient.java | 37 + .../elasticsan/fluent/VolumeGroupsClient.java | 307 ++++ .../elasticsan/fluent/VolumesClient.java | 320 ++++ .../fluent/models/ElasticSanInner.java | 219 +++ .../fluent/models/ElasticSanProperties.java | 229 +++ .../models/ElasticSanRPOperationInner.java | 88 + .../models/ElasticSanUpdateProperties.java | 72 + .../fluent/models/ResourceTypeSkuInner.java | 160 ++ .../fluent/models/VolumeGroupInner.java | 152 ++ .../fluent/models/VolumeGroupProperties.java | 136 ++ .../models/VolumeGroupUpdateProperties.java | 120 ++ .../elasticsan/fluent/models/VolumeInner.java | 136 ++ .../fluent/models/VolumeProperties.java | 110 ++ .../fluent/models/VolumeUpdateProperties.java | 46 + .../fluent/models/package-info.java | 6 + .../elasticsan/fluent/package-info.java | 6 + .../implementation/ElasticSanImpl.java | 242 +++ .../ElasticSanManagementBuilder.java | 145 ++ .../ElasticSanManagementImpl.java | 349 ++++ .../ElasticSanRPOperationImpl.java | 41 + .../implementation/ElasticSansClientImpl.java | 1591 +++++++++++++++++ .../implementation/ElasticSansImpl.java | 175 ++ .../implementation/OperationsClientImpl.java | 175 ++ .../implementation/OperationsImpl.java | 45 + .../implementation/ResourceTypeSkuImpl.java | 60 + .../implementation/SkusClientImpl.java | 197 ++ .../elasticsan/implementation/SkusImpl.java | 44 + .../elasticsan/implementation/Utils.java | 204 +++ .../implementation/VolumeGroupImpl.java | 224 +++ .../VolumeGroupsClientImpl.java | 1519 ++++++++++++++++ .../implementation/VolumeGroupsImpl.java | 201 +++ .../elasticsan/implementation/VolumeImpl.java | 216 +++ .../implementation/VolumesClientImpl.java | 1585 ++++++++++++++++ .../implementation/VolumesImpl.java | 224 +++ .../implementation/package-info.java | 6 + .../elasticsan/models/Action.java | 44 + .../elasticsan/models/ElasticSan.java | 316 ++++ .../elasticsan/models/ElasticSanList.java | 73 + .../models/ElasticSanOperationDisplay.java | 156 ++ .../models/ElasticSanOperationListResult.java | 85 + .../models/ElasticSanRPOperation.java | 38 + .../elasticsan/models/ElasticSanUpdate.java | 114 ++ .../elasticsan/models/ElasticSans.java | 170 ++ .../elasticsan/models/EncryptionType.java | 40 + .../elasticsan/models/IscsiTargetInfo.java | 107 ++ .../elasticsan/models/Name.java | 37 + .../elasticsan/models/NetworkRuleSet.java | 50 + .../elasticsan/models/OperationalStatus.java | 52 + .../elasticsan/models/Operations.java | 31 + .../elasticsan/models/ProvisioningStates.java | 52 + .../elasticsan/models/ResourceTypeSku.java | 53 + .../elasticsan/models/SanTierInfo.java | 140 ++ .../elasticsan/models/Sku.java | 72 + .../elasticsan/models/SkuInformationList.java | 55 + .../elasticsan/models/SkuLocationInfo.java | 51 + .../elasticsan/models/Skus.java | 32 + .../elasticsan/models/SourceCreationData.java | 84 + .../elasticsan/models/State.java | 56 + .../elasticsan/models/StorageTargetType.java | 34 + .../elasticsan/models/Tier.java | 37 + .../elasticsan/models/VirtualNetworkRule.java | 99 + .../elasticsan/models/Volume.java | 261 +++ .../elasticsan/models/VolumeCreateOption.java | 53 + .../elasticsan/models/VolumeGroup.java | 284 +++ .../elasticsan/models/VolumeGroupList.java | 73 + .../models/VolumeGroupTierInfo.java | 35 + .../elasticsan/models/VolumeGroupUpdate.java | 137 ++ .../elasticsan/models/VolumeGroups.java | 162 ++ .../elasticsan/models/VolumeList.java | 73 + .../elasticsan/models/VolumeTierInfo.java | 140 ++ .../elasticsan/models/VolumeUpdate.java | 91 + .../elasticsan/models/Volumes.java | 150 ++ .../elasticsan/models/package-info.java | 6 + .../elasticsan/package-info.java | 6 + .../src/main/java/module-info.java | 19 + .../generated/ElasticSansCreateSamples.java | 48 + .../generated/ElasticSansDeleteSamples.java | 34 + .../ElasticSansGetByResourceGroupSamples.java | 22 + ...ElasticSansListByResourceGroupSamples.java | 23 + .../generated/ElasticSansListSamples.java | 23 + .../generated/ElasticSansUpdateSamples.java | 41 + .../generated/OperationsListSamples.java | 34 + .../elasticsan/generated/SkusListSamples.java | 34 + .../generated/VolumeGroupsCreateSamples.java | 71 + .../generated/VolumeGroupsDeleteSamples.java | 38 + .../generated/VolumeGroupsGetSamples.java | 38 + .../VolumeGroupsListByElasticSanSamples.java | 36 + .../generated/VolumeGroupsUpdateSamples.java | 65 + .../generated/VolumesCreateSamples.java | 64 + .../generated/VolumesDeleteSamples.java | 38 + .../generated/VolumesGetSamples.java | 40 + .../VolumesListByVolumeGroupSamples.java | 40 + .../generated/VolumesUpdateSamples.java | 60 + sdk/elasticsan/ci.yml | 39 + sdk/elasticsan/pom.xml | 53 + 105 files changed, 15454 insertions(+) create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/README.md create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/ElasticSanManager.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/Utils.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesClientImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/package-info.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Action.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSan.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanUpdate.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSans.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionType.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IscsiTargetInfo.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Name.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/NetworkRuleSet.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operations.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ResourceTypeSku.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SanTierInfo.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Sku.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuInformationList.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuLocationInfo.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Skus.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SourceCreationData.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/State.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Tier.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VirtualNetworkRule.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volume.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeCreateOption.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroup.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupTierInfo.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupUpdate.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroups.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeTierInfo.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeUpdate.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volumes.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/package-info.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/package-info.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/module-info.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansUpdateSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/OperationsListSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/SkusListSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsUpdateSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesUpdateSamples.java create mode 100644 sdk/elasticsan/ci.yml create mode 100644 sdk/elasticsan/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 9a7e5862267f2..a5e831d3d8d55 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -333,6 +333,7 @@ com.azure.resourcemanager:azure-resourcemanager-dnsresolver;1.0.0-beta.1;1.0.0-b com.azure.resourcemanager:azure-resourcemanager-mobilenetwork;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-azureadexternalidentities;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-dashboard;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-elasticsan;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index ba604d611551c..91bb8c9ff643e 100644 --- a/pom.xml +++ b/pom.xml @@ -894,6 +894,7 @@ sdk/dnsresolver sdk/edgeorder sdk/elastic + sdk/elasticsan sdk/eventgrid sdk/eventhubs sdk/extendedlocation diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md new file mode 100644 index 0000000000000..6042eab1b6c52 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-04-12) + +- Azure Resource Manager ElasticSan client library for Java. This package contains Microsoft Azure SDK for ElasticSan Management SDK. Package tag package-2021-11-20-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md new file mode 100644 index 0000000000000..8b25c14b4fc77 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ElasticSan client library for Java + +Azure Resource Manager ElasticSan client library for Java. + +This package contains Microsoft Azure SDK for ElasticSan Management SDK. Package tag package-2021-11-20-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-elasticsan;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-elasticsan + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ElasticSanManager manager = ElasticSanManager + .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/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md new file mode 100644 index 0000000000000..c8b5ea22536d0 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md @@ -0,0 +1,766 @@ +# Code snippets and samples + + +## ElasticSans + +- [Create](#elasticsans_create) +- [Delete](#elasticsans_delete) +- [GetByResourceGroup](#elasticsans_getbyresourcegroup) +- [List](#elasticsans_list) +- [ListByResourceGroup](#elasticsans_listbyresourcegroup) +- [Update](#elasticsans_update) + +## Operations + +- [List](#operations_list) + +## Skus + +- [List](#skus_list) + +## VolumeGroups + +- [Create](#volumegroups_create) +- [Delete](#volumegroups_delete) +- [Get](#volumegroups_get) +- [ListByElasticSan](#volumegroups_listbyelasticsan) +- [Update](#volumegroups_update) + +## Volumes + +- [Create](#volumes_create) +- [Delete](#volumes_delete) +- [Get](#volumes_get) +- [ListByVolumeGroup](#volumes_listbyvolumegroup) +- [Update](#volumes_update) +### ElasticSans_Create + +```java +import com.azure.resourcemanager.elasticsan.models.Name; +import com.azure.resourcemanager.elasticsan.models.Sku; +import com.azure.resourcemanager.elasticsan.models.Tier; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ElasticSans Create. */ +public final class ElasticSansCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .elasticSans() + .define("33zg-7s_4_7L2_65o") + .withRegion("aaaaaaaaaaaaaaaaaaaaaaaaa") + .withExistingResourceGroup("rgelasticsan") + .withTags(mapOf("key3875", "aaaaaaaaa")) + .withSku(new Sku().withName(Name.STANDARD_LRS).withTier(Tier.fromString("Standard"))) + .withAvailabilityZones(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")) + .withBaseSizeTiB(26L) + .withExtendedCapacitySizeTiB(4L) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ElasticSans_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ElasticSans Delete. */ +public final class ElasticSansDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().delete("rgelasticsan", "33zg-7s_4_7L2_65o", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().delete("rgelasticsan", "33zg-7s_4_7L2_65o", true, Context.NONE); + } +} +``` + +### ElasticSans_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ElasticSans GetByResourceGroup. */ +public final class ElasticSansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().getByResourceGroupWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE); + } +} +``` + +### ElasticSans_List + +```java +import com.azure.core.util.Context; + +/** Samples for ElasticSans List. */ +public final class ElasticSansListSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().list(Context.NONE); + } +} +``` + +### ElasticSans_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for ElasticSans ListByResourceGroup. */ +public final class ElasticSansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().listByResourceGroup("rgelasticsan", Context.NONE); + } +} +``` + +### ElasticSans_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.models.ElasticSan; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ElasticSans Update. */ +public final class ElasticSansUpdateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Update_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansUpdateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + ElasticSan resource = + manager + .elasticSans() + .getByResourceGroupWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key337", "aaaa")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.operations().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MinimumSet_Gen.json + */ + /** + * Sample code: Skus_List_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void skusListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.skus().list(null, Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MaximumSet_Gen.json + */ + /** + * Sample code: Skus_List_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void skusListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.skus().list("aaaaaaaaaaaa", Context.NONE); + } +} +``` + +### VolumeGroups_Create + +```java +import com.azure.resourcemanager.elasticsan.models.Action; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VolumeGroups Create. */ +public final class VolumeGroupsCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .define("9_67U25-1f2gR3-b6L-4T5") + .withRegion((String) null) + .withExistingElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o") + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .define("9_67U25-1f2gR3-b6L-4T5") + .withRegion("aaaaaaaaaaaaaaaaaaaaaa") + .withExistingElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o") + .withTags(mapOf("key3582", "a")) + .withProtocolType(StorageTargetType.ISCSI) + .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .withNetworkAcls( + new NetworkRuleSet() + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule().withVirtualNetworkResourceId("aa").withAction(Action.ALLOW)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VolumeGroups_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for VolumeGroups Delete. */ +public final class VolumeGroupsDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", true, Context.NONE); + } +} +``` + +### VolumeGroups_Get + +```java +import com.azure.core.util.Context; + +/** Samples for VolumeGroups Get. */ +public final class VolumeGroupsGetSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } +} +``` + +### VolumeGroups_ListByElasticSan + +```java +import com.azure.core.util.Context; + +/** Samples for VolumeGroups ListByElasticSan. */ +public final class VolumeGroupsListByElasticSanSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsListByElasticSanMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.volumeGroups().listByElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsListByElasticSanMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.volumeGroups().listByElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE); + } +} +``` + +### VolumeGroups_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.VolumeGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VolumeGroups Update. */ +public final class VolumeGroupsUpdateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Update_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsUpdateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + VolumeGroup resource = + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key7736", "aa")) + .withProtocolType(StorageTargetType.ISCSI) + .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .apply(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Update_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsUpdateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + VolumeGroup resource = + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Volumes_Create + +```java +import com.azure.resourcemanager.elasticsan.models.SourceCreationData; +import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes Create. */ +public final class VolumesCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .define("vt-h45-18D68-j3sg8") + .withRegion("aaaaaaaaaaa") + .withExistingVolumegroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5") + .withTags(mapOf("key9122", "aaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withCreationData( + new SourceCreationData() + .withCreateSource(VolumeCreateOption.NONE) + .withSourceUri("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withSizeGiB(30L) + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .define("vt-h45-18D68-j3sg8") + .withRegion((String) null) + .withExistingVolumegroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Volumes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Volumes Delete. */ +public final class VolumesDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } +} +``` + +### Volumes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Volumes Get. */ +public final class VolumesGetSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } +} +``` + +### Volumes_ListByVolumeGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Volumes ListByVolumeGroup. */ +public final class VolumesListByVolumeGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesListByVolumeGroupMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .listByVolumeGroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesListByVolumeGroupMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .listByVolumeGroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } +} +``` + +### Volumes_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.models.Volume; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes Update. */ +public final class VolumesUpdateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Update_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesUpdateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + Volume resource = + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Update_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesUpdateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + Volume resource = + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4653", "aaaaaaaaa")).withSizeGiB(23L).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml new file mode 100644 index 0000000000000..0bbcf37fc49ac --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-elasticsan + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for ElasticSan Management + This package contains Microsoft Azure SDK for ElasticSan Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-11-20-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.27.0 + + + com.azure + azure-core-management + 1.5.4 + + + diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/ElasticSanManager.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/ElasticSanManager.java new file mode 100644 index 0000000000000..412809546d426 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/ElasticSanManager.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan; + +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.elasticsan.fluent.ElasticSanManagement; +import com.azure.resourcemanager.elasticsan.implementation.ElasticSanManagementBuilder; +import com.azure.resourcemanager.elasticsan.implementation.ElasticSansImpl; +import com.azure.resourcemanager.elasticsan.implementation.OperationsImpl; +import com.azure.resourcemanager.elasticsan.implementation.SkusImpl; +import com.azure.resourcemanager.elasticsan.implementation.VolumeGroupsImpl; +import com.azure.resourcemanager.elasticsan.implementation.VolumesImpl; +import com.azure.resourcemanager.elasticsan.models.ElasticSans; +import com.azure.resourcemanager.elasticsan.models.Operations; +import com.azure.resourcemanager.elasticsan.models.Skus; +import com.azure.resourcemanager.elasticsan.models.VolumeGroups; +import com.azure.resourcemanager.elasticsan.models.Volumes; +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 ElasticSanManager. */ +public final class ElasticSanManager { + private Operations operations; + + private Skus skus; + + private ElasticSans elasticSans; + + private VolumeGroups volumeGroups; + + private Volumes volumes; + + private final ElasticSanManagement clientObject; + + private ElasticSanManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ElasticSanManagementBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ElasticSan service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ElasticSan service API instance. + */ + public static ElasticSanManager 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 ElasticSan service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the ElasticSan service API instance. + */ + public static ElasticSanManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ElasticSanManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create ElasticSanManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ElasticSanManager.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 ElasticSan service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ElasticSan service API instance. + */ + public ElasticSanManager 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.elasticsan") + .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 ElasticSanManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** @return Resource collection API of ElasticSans. */ + public ElasticSans elasticSans() { + if (this.elasticSans == null) { + this.elasticSans = new ElasticSansImpl(clientObject.getElasticSans(), this); + } + return elasticSans; + } + + /** @return Resource collection API of VolumeGroups. */ + public VolumeGroups volumeGroups() { + if (this.volumeGroups == null) { + this.volumeGroups = new VolumeGroupsImpl(clientObject.getVolumeGroups(), this); + } + return volumeGroups; + } + + /** @return Resource collection API of Volumes. */ + public Volumes volumes() { + if (this.volumes == null) { + this.volumes = new VolumesImpl(clientObject.getVolumes(), this); + } + return volumes; + } + + /** + * @return Wrapped service client ElasticSanManagement providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + */ + public ElasticSanManagement serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java new file mode 100644 index 0000000000000..2d251f2bd9129 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ElasticSanManagement class. */ +public interface ElasticSanManagement { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the ElasticSansClient object to access its operations. + * + * @return the ElasticSansClient object. + */ + ElasticSansClient getElasticSans(); + + /** + * Gets the VolumeGroupsClient object to access its operations. + * + * @return the VolumeGroupsClient object. + */ + VolumeGroupsClient getVolumeGroups(); + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + VolumesClient getVolumes(); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java new file mode 100644 index 0000000000000..e1c6e169af05a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.models.ElasticSanInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate; + +/** An instance of this class provides access to all the operations defined in ElasticSansClient. */ +public interface ElasticSansClient { + /** + * Gets a list of ElasticSans 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 a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of ElasticSans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticSanInner> beginCreate( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters); + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticSanInner> beginCreate( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context); + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticSanInner create(String resourceGroupName, String elasticSanName, ElasticSanInner parameters); + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticSanInner create( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context); + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticSanInner> beginUpdate( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters); + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ElasticSanInner> beginUpdate( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context); + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticSanInner update(String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters); + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticSanInner update( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume Groups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 elasticSanName, Boolean forceDeleteVolumeGroups); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume Groups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, Boolean forceDeleteVolumeGroups); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context); + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ElasticSanInner getByResourceGroup(String resourceGroupName, String elasticSanName); + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String elasticSanName, Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java new file mode 100644 index 0000000000000..d58c5fd9796fe --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.models.ElasticSanRPOperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.java new file mode 100644 index 0000000000000..fd4fe1bed370f --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.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.elasticsan.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.elasticsan.fluent.models.ResourceTypeSkuInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * List all the available Skus in the region and information related to them. + * + * @throws com.azure.core.management.exception.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 SKU Information objects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SKU Information objects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java new file mode 100644 index 0000000000000..bb3b677c1827d --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.models.VolumeGroupInner; +import com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate; + +/** An instance of this class provides access to all the operations defined in VolumeGroupsClient. */ +public interface VolumeGroupsClient { + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volume Groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName); + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volume Groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName, Context context); + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeGroupInner> beginCreate( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters); + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeGroupInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner parameters, + Context context); + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeGroupInner create( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters); + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeGroupInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner parameters, + Context context); + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeGroupInner> beginUpdate( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters); + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeGroupInner> beginUpdate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate parameters, + Context context); + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeGroupInner update( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters); + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeGroupInner update( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate parameters, + Context context); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context); + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeGroupInner get(String resourceGroupName, String elasticSanName, String volumeGroupName); + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java new file mode 100644 index 0000000000000..32fb71b55b122 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.models.VolumeInner; +import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; + +/** An instance of this class provides access to all the operations defined in VolumesClient. */ +public interface VolumesClient { + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters); + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters, + Context context); + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters); + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters, + Context context); + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters); + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters, + Context context); + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner update( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters); + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner update( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters, + Context context); + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 elasticSanName, String volumeGroupName, String volumeName); + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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 elasticSanName, String volumeGroupName, String volumeName, Context context); + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName, String volumeName); + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName, String volumeName, Context context); + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VolumeInner get(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName); + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context); + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volumes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName); + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volumes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java new file mode 100644 index 0000000000000..28ec0a121ce6c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Response for ElasticSan request. */ +@Fluent +public final class ElasticSanInner extends Resource { + /* + * Properties of ElasticSan. + */ + @JsonProperty(value = "properties") + private ElasticSanProperties innerProperties; + + /* + * Resource metadata required by ARM RPC + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of ElasticSan. + * + * @return the innerProperties value. + */ + private ElasticSanProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ElasticSanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ElasticSanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the sku property: resource sku. + * + * @return the sku value. + */ + public Sku sku() { + return this.innerProperties() == null ? null : this.innerProperties().sku(); + } + + /** + * Set the sku property: resource sku. + * + * @param sku the sku value to set. + * @return the ElasticSanInner object itself. + */ + public ElasticSanInner withSku(Sku sku) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanProperties(); + } + this.innerProperties().withSku(sku); + return this; + } + + /** + * Get the availabilityZones property: Logical zone for Elastic San resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.innerProperties() == null ? null : this.innerProperties().availabilityZones(); + } + + /** + * Set the availabilityZones property: Logical zone for Elastic San resource; example: ["1"]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ElasticSanInner object itself. + */ + public ElasticSanInner withAvailabilityZones(List availabilityZones) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanProperties(); + } + this.innerProperties().withAvailabilityZones(availabilityZones); + return this; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @return the baseSizeTiB value. + */ + public Long baseSizeTiB() { + return this.innerProperties() == null ? null : this.innerProperties().baseSizeTiB(); + } + + /** + * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @param baseSizeTiB the baseSizeTiB value to set. + * @return the ElasticSanInner object itself. + */ + public ElasticSanInner withBaseSizeTiB(Long baseSizeTiB) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanProperties(); + } + this.innerProperties().withBaseSizeTiB(baseSizeTiB); + return this; + } + + /** + * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @return the extendedCapacitySizeTiB value. + */ + public Long extendedCapacitySizeTiB() { + return this.innerProperties() == null ? null : this.innerProperties().extendedCapacitySizeTiB(); + } + + /** + * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set. + * @return the ElasticSanInner object itself. + */ + public ElasticSanInner withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanProperties(); + } + this.innerProperties().withExtendedCapacitySizeTiB(extendedCapacitySizeTiB); + return this; + } + + /** + * Get the totalVolumeSizeGiB property: Total size of the provisioned Volumes in GiB. + * + * @return the totalVolumeSizeGiB value. + */ + public Long totalVolumeSizeGiB() { + return this.innerProperties() == null ? null : this.innerProperties().totalVolumeSizeGiB(); + } + + /** + * Get the volumeGroupCount property: Total number of volume groups in this Elastic San appliance. + * + * @return the volumeGroupCount value. + */ + public Long volumeGroupCount() { + return this.innerProperties() == null ? null : this.innerProperties().volumeGroupCount(); + } + + /** + * Get the totalIops property: Total Provisioned IOPS of the Elastic San appliance. + * + * @return the totalIops value. + */ + public Long totalIops() { + return this.innerProperties() == null ? null : this.innerProperties().totalIops(); + } + + /** + * Get the totalMBps property: Total Provisioned MBps Elastic San appliance. + * + * @return the totalMBps value. + */ + public Long totalMBps() { + return this.innerProperties() == null ? null : this.innerProperties().totalMBps(); + } + + /** + * Get the provisionedMBps property: Provisioned MBps Elastic San appliance. + * + * @return the provisionedMBps value. + */ + public Long provisionedMBps() { + return this.innerProperties() == null ? null : this.innerProperties().provisionedMBps(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java new file mode 100644 index 0000000000000..2a567aa0cb247 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Elastic San response properties. */ +@Fluent +public final class ElasticSanProperties { + /* + * resource sku + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Logical zone for Elastic San resource; example: ["1"]. + */ + @JsonProperty(value = "availabilityZones", required = true) + private List availabilityZones; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Base size of the Elastic San appliance in TiB. + */ + @JsonProperty(value = "baseSizeTiB", required = true) + private long baseSizeTiB; + + /* + * Extended size of the Elastic San appliance in TiB. + */ + @JsonProperty(value = "extendedCapacitySizeTiB", required = true) + private long extendedCapacitySizeTiB; + + /* + * Total size of the provisioned Volumes in GiB. + */ + @JsonProperty(value = "totalVolumeSizeGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long totalVolumeSizeGiB; + + /* + * Total number of volume groups in this Elastic San appliance. + */ + @JsonProperty(value = "volumeGroupCount", access = JsonProperty.Access.WRITE_ONLY) + private Long volumeGroupCount; + + /* + * Total Provisioned IOPS of the Elastic San appliance. + */ + @JsonProperty(value = "totalIops", access = JsonProperty.Access.WRITE_ONLY) + private Long totalIops; + + /* + * Total Provisioned MBps Elastic San appliance. + */ + @JsonProperty(value = "totalMBps", access = JsonProperty.Access.WRITE_ONLY) + private Long totalMBps; + + /* + * Provisioned MBps Elastic San appliance. + */ + @JsonProperty(value = "provisionedMBps", access = JsonProperty.Access.WRITE_ONLY) + private Long provisionedMBps; + + /** + * Get the sku property: resource sku. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: resource sku. + * + * @param sku the sku value to set. + * @return the ElasticSanProperties object itself. + */ + public ElasticSanProperties withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the availabilityZones property: Logical zone for Elastic San resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + public List availabilityZones() { + return this.availabilityZones; + } + + /** + * Set the availabilityZones property: Logical zone for Elastic San resource; example: ["1"]. + * + * @param availabilityZones the availabilityZones value to set. + * @return the ElasticSanProperties object itself. + */ + public ElasticSanProperties withAvailabilityZones(List availabilityZones) { + this.availabilityZones = availabilityZones; + return this; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + + /** + * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @return the baseSizeTiB value. + */ + public long baseSizeTiB() { + return this.baseSizeTiB; + } + + /** + * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @param baseSizeTiB the baseSizeTiB value to set. + * @return the ElasticSanProperties object itself. + */ + public ElasticSanProperties withBaseSizeTiB(long baseSizeTiB) { + this.baseSizeTiB = baseSizeTiB; + return this; + } + + /** + * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @return the extendedCapacitySizeTiB value. + */ + public long extendedCapacitySizeTiB() { + return this.extendedCapacitySizeTiB; + } + + /** + * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set. + * @return the ElasticSanProperties object itself. + */ + public ElasticSanProperties withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB) { + this.extendedCapacitySizeTiB = extendedCapacitySizeTiB; + return this; + } + + /** + * Get the totalVolumeSizeGiB property: Total size of the provisioned Volumes in GiB. + * + * @return the totalVolumeSizeGiB value. + */ + public Long totalVolumeSizeGiB() { + return this.totalVolumeSizeGiB; + } + + /** + * Get the volumeGroupCount property: Total number of volume groups in this Elastic San appliance. + * + * @return the volumeGroupCount value. + */ + public Long volumeGroupCount() { + return this.volumeGroupCount; + } + + /** + * Get the totalIops property: Total Provisioned IOPS of the Elastic San appliance. + * + * @return the totalIops value. + */ + public Long totalIops() { + return this.totalIops; + } + + /** + * Get the totalMBps property: Total Provisioned MBps Elastic San appliance. + * + * @return the totalMBps value. + */ + public Long totalMBps() { + return this.totalMBps; + } + + /** + * Get the provisionedMBps property: Provisioned MBps Elastic San appliance. + * + * @return the provisionedMBps value. + */ + public Long provisionedMBps() { + return this.provisionedMBps; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (availabilityZones() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property availabilityZones in model ElasticSanProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanProperties.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java new file mode 100644 index 0000000000000..7c19c72ab8012 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.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.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of a ElasticSan RP Operation. */ +@Fluent +public final class ElasticSanRPOperationInner { + /* + * The name of the operation being performed on this particular object + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Indicates whether the operation applies to data-plane. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Additional metadata about RP operation. + */ + @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + private ElasticSanOperationDisplay display; + + /** + * Get the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the operation being performed on this particular object. + * + * @param name the name value to set. + * @return the ElasticSanRPOperationInner object itself. + */ + public ElasticSanRPOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Additional metadata about RP operation. + * + * @return the display value. + */ + public ElasticSanOperationDisplay display() { + return this.display; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ElasticSanRPOperationInner")); + } + if (display() != null) { + display().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanRPOperationInner.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java new file mode 100644 index 0000000000000..1cc1ff38c3887 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Elastic San update properties. */ +@Fluent +public final class ElasticSanUpdateProperties { + /* + * Base size of the Elastic San appliance in TiB. + */ + @JsonProperty(value = "baseSizeTiB", required = true) + private long baseSizeTiB; + + /* + * Extended size of the Elastic San appliance in TiB. + */ + @JsonProperty(value = "extendedCapacitySizeTiB", required = true) + private long extendedCapacitySizeTiB; + + /** + * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @return the baseSizeTiB value. + */ + public long baseSizeTiB() { + return this.baseSizeTiB; + } + + /** + * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @param baseSizeTiB the baseSizeTiB value to set. + * @return the ElasticSanUpdateProperties object itself. + */ + public ElasticSanUpdateProperties withBaseSizeTiB(long baseSizeTiB) { + this.baseSizeTiB = baseSizeTiB; + return this; + } + + /** + * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @return the extendedCapacitySizeTiB value. + */ + public long extendedCapacitySizeTiB() { + return this.extendedCapacitySizeTiB; + } + + /** + * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set. + * @return the ElasticSanUpdateProperties object itself. + */ + public ElasticSanUpdateProperties withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB) { + this.extendedCapacitySizeTiB = extendedCapacitySizeTiB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java new file mode 100644 index 0000000000000..fd6b8c4a44ae0 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.SanTierInfo; +import com.azure.resourcemanager.elasticsan.models.Sku; +import com.azure.resourcemanager.elasticsan.models.SkuLocationInfo; +import com.azure.resourcemanager.elasticsan.models.VolumeGroupTierInfo; +import com.azure.resourcemanager.elasticsan.models.VolumeTierInfo; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SkuInformation object. */ +@Fluent +public final class ResourceTypeSkuInner { + /* + * The Sku tier + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Availability of the SKU for the location/zone + */ + @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY) + private List locationInfo; + + /* + * Scalability targets for the San account for a given tier + */ + @JsonProperty(value = "san") + private SanTierInfo san; + + /* + * Volume Group targets for the San account for a given tier + */ + @JsonProperty(value = "volumeGroup") + private VolumeGroupTierInfo volumeGroup; + + /* + * Volume targets for the San account for a given tier + */ + @JsonProperty(value = "volume") + private VolumeTierInfo volume; + + /** + * Get the sku property: The Sku tier. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The Sku tier. + * + * @param sku the sku value to set. + * @return the ResourceTypeSkuInner object itself. + */ + public ResourceTypeSkuInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the locationInfo property: Availability of the SKU for the location/zone. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Get the san property: Scalability targets for the San account for a given tier. + * + * @return the san value. + */ + public SanTierInfo san() { + return this.san; + } + + /** + * Set the san property: Scalability targets for the San account for a given tier. + * + * @param san the san value to set. + * @return the ResourceTypeSkuInner object itself. + */ + public ResourceTypeSkuInner withSan(SanTierInfo san) { + this.san = san; + return this; + } + + /** + * Get the volumeGroup property: Volume Group targets for the San account for a given tier. + * + * @return the volumeGroup value. + */ + public VolumeGroupTierInfo volumeGroup() { + return this.volumeGroup; + } + + /** + * Set the volumeGroup property: Volume Group targets for the San account for a given tier. + * + * @param volumeGroup the volumeGroup value to set. + * @return the ResourceTypeSkuInner object itself. + */ + public ResourceTypeSkuInner withVolumeGroup(VolumeGroupTierInfo volumeGroup) { + this.volumeGroup = volumeGroup; + return this; + } + + /** + * Get the volume property: Volume targets for the San account for a given tier. + * + * @return the volume value. + */ + public VolumeTierInfo volume() { + return this.volume; + } + + /** + * Set the volume property: Volume targets for the San account for a given tier. + * + * @param volume the volume value to set. + * @return the ResourceTypeSkuInner object itself. + */ + public ResourceTypeSkuInner withVolume(VolumeTierInfo volume) { + this.volume = volume; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (san() != null) { + san().validate(); + } + if (volumeGroup() != null) { + volumeGroup().validate(); + } + if (volume() != null) { + volume().validate(); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java new file mode 100644 index 0000000000000..c77fe68725e9b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Response for Volume Group request. */ +@Fluent +public final class VolumeGroupInner extends Resource { + /* + * Properties of VolumeGroup. + */ + @JsonProperty(value = "properties") + private VolumeGroupProperties innerProperties; + + /* + * Resource metadata required by ARM RPC + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of VolumeGroup. + * + * @return the innerProperties value. + */ + private VolumeGroupProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VolumeGroupInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumeGroupInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the protocolType property: Type of storage target. + * + * @return the protocolType value. + */ + public StorageTargetType protocolType() { + return this.innerProperties() == null ? null : this.innerProperties().protocolType(); + } + + /** + * Set the protocolType property: Type of storage target. + * + * @param protocolType the protocolType value to set. + * @return the VolumeGroupInner object itself. + */ + public VolumeGroupInner withProtocolType(StorageTargetType protocolType) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupProperties(); + } + this.innerProperties().withProtocolType(protocolType); + return this; + } + + /** + * Get the encryption property: Type of encryption. + * + * @return the encryption value. + */ + public EncryptionType encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Type of encryption. + * + * @param encryption the encryption value to set. + * @return the VolumeGroupInner object itself. + */ + public VolumeGroupInner withEncryption(EncryptionType encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @return the networkAcls value. + */ + public NetworkRuleSet networkAcls() { + return this.innerProperties() == null ? null : this.innerProperties().networkAcls(); + } + + /** + * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @param networkAcls the networkAcls value to set. + * @return the VolumeGroupInner object itself. + */ + public VolumeGroupInner withNetworkAcls(NetworkRuleSet networkAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupProperties(); + } + this.innerProperties().withNetworkAcls(networkAcls); + 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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java new file mode 100644 index 0000000000000..5a74085eefc2a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VolumeGroup response properties. */ +@Fluent +public final class VolumeGroupProperties { + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Type of storage target + */ + @JsonProperty(value = "protocolType", required = true) + private StorageTargetType protocolType; + + /* + * Type of encryption + */ + @JsonProperty(value = "encryption", required = true) + private EncryptionType encryption; + + /* + * A collection of rules governing the accessibility from specific network + * locations. + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkAcls; + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + + /** + * Get the protocolType property: Type of storage target. + * + * @return the protocolType value. + */ + public StorageTargetType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Type of storage target. + * + * @param protocolType the protocolType value to set. + * @return the VolumeGroupProperties object itself. + */ + public VolumeGroupProperties withProtocolType(StorageTargetType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the encryption property: Type of encryption. + * + * @return the encryption value. + */ + public EncryptionType encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Type of encryption. + * + * @param encryption the encryption value to set. + * @return the VolumeGroupProperties object itself. + */ + public VolumeGroupProperties withEncryption(EncryptionType encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @return the networkAcls value. + */ + public NetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @param networkAcls the networkAcls value to set. + * @return the VolumeGroupProperties object itself. + */ + public VolumeGroupProperties withNetworkAcls(NetworkRuleSet networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocolType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocolType in model VolumeGroupProperties")); + } + if (encryption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property encryption in model VolumeGroupProperties")); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupProperties.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.java new file mode 100644 index 0000000000000..5ea21c2f37087 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.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.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** VolumeGroup response properties. */ +@Fluent +public final class VolumeGroupUpdateProperties { + /* + * Type of storage target + */ + @JsonProperty(value = "protocolType", required = true) + private StorageTargetType protocolType; + + /* + * Type of encryption + */ + @JsonProperty(value = "encryption", required = true) + private EncryptionType encryption; + + /* + * A collection of rules governing the accessibility from specific network + * locations. + */ + @JsonProperty(value = "networkAcls") + private NetworkRuleSet networkAcls; + + /** + * Get the protocolType property: Type of storage target. + * + * @return the protocolType value. + */ + public StorageTargetType protocolType() { + return this.protocolType; + } + + /** + * Set the protocolType property: Type of storage target. + * + * @param protocolType the protocolType value to set. + * @return the VolumeGroupUpdateProperties object itself. + */ + public VolumeGroupUpdateProperties withProtocolType(StorageTargetType protocolType) { + this.protocolType = protocolType; + return this; + } + + /** + * Get the encryption property: Type of encryption. + * + * @return the encryption value. + */ + public EncryptionType encryption() { + return this.encryption; + } + + /** + * Set the encryption property: Type of encryption. + * + * @param encryption the encryption value to set. + * @return the VolumeGroupUpdateProperties object itself. + */ + public VolumeGroupUpdateProperties withEncryption(EncryptionType encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @return the networkAcls value. + */ + public NetworkRuleSet networkAcls() { + return this.networkAcls; + } + + /** + * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @param networkAcls the networkAcls value to set. + * @return the VolumeGroupUpdateProperties object itself. + */ + public VolumeGroupUpdateProperties withNetworkAcls(NetworkRuleSet networkAcls) { + this.networkAcls = networkAcls; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (protocolType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property protocolType in model VolumeGroupUpdateProperties")); + } + if (encryption() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property encryption in model VolumeGroupUpdateProperties")); + } + if (networkAcls() != null) { + networkAcls().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupUpdateProperties.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.java new file mode 100644 index 0000000000000..5fb3c0790c951 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo; +import com.azure.resourcemanager.elasticsan.models.SourceCreationData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Response for Volume request. */ +@Fluent +public final class VolumeInner extends Resource { + /* + * Properties of Volume. + */ + @JsonProperty(value = "properties") + private VolumeProperties innerProperties; + + /* + * Resource metadata required by ARM RPC + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of Volume. + * + * @return the innerProperties value. + */ + private VolumeProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public VolumeInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public VolumeInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the volumeId property: Unique Id of the volume in GUID format. + * + * @return the volumeId value. + */ + public String volumeId() { + return this.innerProperties() == null ? null : this.innerProperties().volumeId(); + } + + /** + * Get the creationData property: State of the operation on the resource. + * + * @return the creationData value. + */ + public SourceCreationData creationData() { + return this.innerProperties() == null ? null : this.innerProperties().creationData(); + } + + /** + * Set the creationData property: State of the operation on the resource. + * + * @param creationData the creationData value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withCreationData(SourceCreationData creationData) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeProperties(); + } + this.innerProperties().withCreationData(creationData); + return this; + } + + /** + * Get the sizeGiB property: Volume size. + * + * @return the sizeGiB value. + */ + public Long sizeGiB() { + return this.innerProperties() == null ? null : this.innerProperties().sizeGiB(); + } + + /** + * Set the sizeGiB property: Volume size. + * + * @param sizeGiB the sizeGiB value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withSizeGiB(Long sizeGiB) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeProperties(); + } + this.innerProperties().withSizeGiB(sizeGiB); + return this; + } + + /** + * Get the storageTarget property: Storage target information. + * + * @return the storageTarget value. + */ + public IscsiTargetInfo storageTarget() { + return this.innerProperties() == null ? null : this.innerProperties().storageTarget(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java new file mode 100644 index 0000000000000..6c88d76458b6f --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo; +import com.azure.resourcemanager.elasticsan.models.SourceCreationData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume response properties. */ +@Fluent +public final class VolumeProperties { + /* + * Unique Id of the volume in GUID format + */ + @JsonProperty(value = "volumeId", access = JsonProperty.Access.WRITE_ONLY) + private String volumeId; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "creationData") + private SourceCreationData creationData; + + /* + * Volume size. + */ + @JsonProperty(value = "sizeGiB") + private Long sizeGiB; + + /* + * Storage target information + */ + @JsonProperty(value = "storageTarget", access = JsonProperty.Access.WRITE_ONLY) + private IscsiTargetInfo storageTarget; + + /** + * Get the volumeId property: Unique Id of the volume in GUID format. + * + * @return the volumeId value. + */ + public String volumeId() { + return this.volumeId; + } + + /** + * Get the creationData property: State of the operation on the resource. + * + * @return the creationData value. + */ + public SourceCreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: State of the operation on the resource. + * + * @param creationData the creationData value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withCreationData(SourceCreationData creationData) { + this.creationData = creationData; + return this; + } + + /** + * Get the sizeGiB property: Volume size. + * + * @return the sizeGiB value. + */ + public Long sizeGiB() { + return this.sizeGiB; + } + + /** + * Set the sizeGiB property: Volume size. + * + * @param sizeGiB the sizeGiB value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withSizeGiB(Long sizeGiB) { + this.sizeGiB = sizeGiB; + return this; + } + + /** + * Get the storageTarget property: Storage target information. + * + * @return the storageTarget value. + */ + public IscsiTargetInfo storageTarget() { + return this.storageTarget; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (creationData() != null) { + creationData().validate(); + } + if (storageTarget() != null) { + storageTarget().validate(); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.java new file mode 100644 index 0000000000000..6bea416abc848 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.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.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume response properties. */ +@Fluent +public final class VolumeUpdateProperties { + /* + * Volume size. + */ + @JsonProperty(value = "sizeGiB") + private Long sizeGiB; + + /** + * Get the sizeGiB property: Volume size. + * + * @return the sizeGiB value. + */ + public Long sizeGiB() { + return this.sizeGiB; + } + + /** + * Set the sizeGiB property: Volume size. + * + * @param sizeGiB the sizeGiB value to set. + * @return the VolumeUpdateProperties object itself. + */ + public VolumeUpdateProperties withSizeGiB(Long sizeGiB) { + this.sizeGiB = sizeGiB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java new file mode 100644 index 0000000000000..fdc2bc9ba692d --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ElasticSanManagement. null. */ +package com.azure.resourcemanager.elasticsan.fluent.models; diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java new file mode 100644 index 0000000000000..1e24c33da5034 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ElasticSanManagement. null. */ +package com.azure.resourcemanager.elasticsan.fluent; diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java new file mode 100644 index 0000000000000..6e5a9f741c0fd --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSan; +import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.Sku; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class ElasticSanImpl implements ElasticSan, ElasticSan.Definition, ElasticSan.Update { + private ElasticSanInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public List availabilityZones() { + List inner = this.innerModel().availabilityZones(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + + public long baseSizeTiB() { + return this.innerModel().baseSizeTiB(); + } + + public long extendedCapacitySizeTiB() { + return this.innerModel().extendedCapacitySizeTiB(); + } + + public Long totalVolumeSizeGiB() { + return this.innerModel().totalVolumeSizeGiB(); + } + + public Long volumeGroupCount() { + return this.innerModel().volumeGroupCount(); + } + + public Long totalIops() { + return this.innerModel().totalIops(); + } + + public Long totalMBps() { + return this.innerModel().totalMBps(); + } + + public Long provisionedMBps() { + return this.innerModel().provisionedMBps(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ElasticSanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String elasticSanName; + + private ElasticSanUpdate updateParameters; + + public ElasticSanImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ElasticSan create() { + this.innerObject = + serviceManager + .serviceClient() + .getElasticSans() + .create(resourceGroupName, elasticSanName, this.innerModel(), Context.NONE); + return this; + } + + public ElasticSan create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getElasticSans() + .create(resourceGroupName, elasticSanName, this.innerModel(), context); + return this; + } + + ElasticSanImpl(String name, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = new ElasticSanInner(); + this.serviceManager = serviceManager; + this.elasticSanName = name; + } + + public ElasticSanImpl update() { + this.updateParameters = new ElasticSanUpdate(); + return this; + } + + public ElasticSan apply() { + this.innerObject = + serviceManager + .serviceClient() + .getElasticSans() + .update(resourceGroupName, elasticSanName, updateParameters, Context.NONE); + return this; + } + + public ElasticSan apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getElasticSans() + .update(resourceGroupName, elasticSanName, updateParameters, context); + return this; + } + + ElasticSanImpl(ElasticSanInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.elasticSanName = Utils.getValueFromIdByName(innerObject.id(), "elasticSans"); + } + + public ElasticSan refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getElasticSans() + .getByResourceGroupWithResponse(resourceGroupName, elasticSanName, Context.NONE) + .getValue(); + return this; + } + + public ElasticSan refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getElasticSans() + .getByResourceGroupWithResponse(resourceGroupName, elasticSanName, context) + .getValue(); + return this; + } + + public ElasticSanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ElasticSanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ElasticSanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public ElasticSanImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } + + public ElasticSanImpl withAvailabilityZones(List availabilityZones) { + this.innerModel().withAvailabilityZones(availabilityZones); + return this; + } + + public ElasticSanImpl withBaseSizeTiB(long baseSizeTiB) { + this.innerModel().withBaseSizeTiB(baseSizeTiB); + return this; + } + + public ElasticSanImpl withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB) { + this.innerModel().withExtendedCapacitySizeTiB(extendedCapacitySizeTiB); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java new file mode 100644 index 0000000000000..f238ed3a1981b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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 ElasticSanManagementImpl type. */ +@ServiceClientBuilder(serviceClients = {ElasticSanManagementImpl.class}) +public final class ElasticSanManagementBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ElasticSanManagementBuilder. + */ + public ElasticSanManagementBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ElasticSanManagementBuilder. + */ + public ElasticSanManagementBuilder 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 ElasticSanManagementBuilder. + */ + public ElasticSanManagementBuilder 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 ElasticSanManagementBuilder. + */ + public ElasticSanManagementBuilder 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 ElasticSanManagementBuilder. + */ + public ElasticSanManagementBuilder 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 ElasticSanManagementBuilder. + */ + public ElasticSanManagementBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ElasticSanManagementImpl with the provided parameters. + * + * @return an instance of ElasticSanManagementImpl. + */ + public ElasticSanManagementImpl buildClient() { + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ElasticSanManagementImpl client = + new ElasticSanManagementImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java new file mode 100644 index 0000000000000..c1523f5a41291 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.elasticsan.fluent.ElasticSanManagement; +import com.azure.resourcemanager.elasticsan.fluent.ElasticSansClient; +import com.azure.resourcemanager.elasticsan.fluent.OperationsClient; +import com.azure.resourcemanager.elasticsan.fluent.SkusClient; +import com.azure.resourcemanager.elasticsan.fluent.VolumeGroupsClient; +import com.azure.resourcemanager.elasticsan.fluent.VolumesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ElasticSanManagementImpl type. */ +@ServiceClient(builder = ElasticSanManagementBuilder.class) +public final class ElasticSanManagementImpl implements ElasticSanManagement { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The 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 SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The ElasticSansClient object to access its operations. */ + private final ElasticSansClient elasticSans; + + /** + * Gets the ElasticSansClient object to access its operations. + * + * @return the ElasticSansClient object. + */ + public ElasticSansClient getElasticSans() { + return this.elasticSans; + } + + /** The VolumeGroupsClient object to access its operations. */ + private final VolumeGroupsClient volumeGroups; + + /** + * Gets the VolumeGroupsClient object to access its operations. + * + * @return the VolumeGroupsClient object. + */ + public VolumeGroupsClient getVolumeGroups() { + return this.volumeGroups; + } + + /** The VolumesClient object to access its operations. */ + private final VolumesClient volumes; + + /** + * Gets the VolumesClient object to access its operations. + * + * @return the VolumesClient object. + */ + public VolumesClient getVolumes() { + return this.volumes; + } + + /** + * Initializes an instance of ElasticSanManagement client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + ElasticSanManagementImpl( + 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 = "2021-11-20-preview"; + this.operations = new OperationsClientImpl(this); + this.skus = new SkusClientImpl(this); + this.elasticSans = new ElasticSansClientImpl(this); + this.volumeGroups = new VolumeGroupsClientImpl(this); + this.volumes = new VolumesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanManagementImpl.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java new file mode 100644 index 0000000000000..f356292f67b28 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.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.elasticsan.implementation; + +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationDisplay; +import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation; + +public final class ElasticSanRPOperationImpl implements ElasticSanRPOperation { + private ElasticSanRPOperationInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + ElasticSanRPOperationImpl( + ElasticSanRPOperationInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public ElasticSanOperationDisplay display() { + return this.innerModel().display(); + } + + public ElasticSanRPOperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java new file mode 100644 index 0000000000000..00b7ee6edbda2 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java @@ -0,0 +1,1591 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.ElasticSansClient; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSanList; +import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate; +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 ElasticSansClient. */ +public final class ElasticSansClientImpl implements ElasticSansClient { + /** The proxy service used to perform REST calls. */ + private final ElasticSansService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of ElasticSansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ElasticSansClientImpl(ElasticSanManagementImpl client) { + this.service = + RestProxy.create(ElasticSansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementElasticSans to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + private interface ElasticSansService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ElasticSanInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ElasticSanUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @HeaderParam("x-ms-delete-volumegroups") Boolean forceDeleteVolumeGroups, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of ElasticSans 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 a list of ElasticSans in a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of ElasticSans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSans in a subscription along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of ElasticSans 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 a list of ElasticSans in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of ElasticSans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSans in a subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of ElasticSans 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 a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of ElasticSans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String elasticSanName, ElasticSanInner 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName 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 + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String elasticSanName, ElasticSanInner 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName 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 + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticSanInner> beginCreateAsync( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, elasticSanName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ElasticSanInner.class, + ElasticSanInner.class, + this.client.getContext()); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticSanInner> beginCreateAsync( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, elasticSanName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ElasticSanInner.class, ElasticSanInner.class, context); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticSanInner> beginCreate( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller(); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticSanInner> beginCreate( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller(); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticSanInner create(String resourceGroupName, String elasticSanName, ElasticSanInner parameters) { + return createAsync(resourceGroupName, elasticSanName, parameters).block(); + } + + /** + * Create ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticSanInner create( + String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) { + return createAsync(resourceGroupName, elasticSanName, parameters, context).block(); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String elasticSanName, ElasticSanUpdate 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String elasticSanName, ElasticSanUpdate 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticSanInner> beginUpdateAsync( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, elasticSanName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ElasticSanInner.class, + ElasticSanInner.class, + this.client.getContext()); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ElasticSanInner> beginUpdateAsync( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, elasticSanName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ElasticSanInner.class, ElasticSanInner.class, context); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticSanInner> beginUpdate( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) { + return beginUpdateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller(); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ElasticSanInner> beginUpdate( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller(); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) { + return beginUpdateAsync(resourceGroupName, elasticSanName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) { + return beginUpdateAsync(resourceGroupName, elasticSanName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticSanInner update(String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) { + return updateAsync(resourceGroupName, elasticSanName, parameters).block(); + } + + /** + * Update a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param parameters Elastic San object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for ElasticSan request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticSanInner update( + String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) { + return updateAsync(resourceGroupName, elasticSanName, parameters, context).block(); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + forceDeleteVolumeGroups, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + forceDeleteVolumeGroups, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups) { + return beginDeleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups).getSyncPoller(); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups, context).getSyncPoller(); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups) { + return beginDeleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 elasticSanName) { + final Boolean forceDeleteVolumeGroups = null; + return beginDeleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups) { + deleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups).block(); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 elasticSanName) { + final Boolean forceDeleteVolumeGroups = null; + deleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups).block(); + } + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context) { + deleteAsync(resourceGroupName, elasticSanName, forceDeleteVolumeGroups, context).block(); + } + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String elasticSanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String elasticSanName, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String elasticSanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, elasticSanName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ElasticSanInner getByResourceGroup(String resourceGroupName, String elasticSanName) { + return getByResourceGroupAsync(resourceGroupName, elasticSanName).block(); + } + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String elasticSanName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, elasticSanName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Elastic Sans 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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.java new file mode 100644 index 0000000000000..973ebbcd81cb8 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.ElasticSansClient; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSan; +import com.azure.resourcemanager.elasticsan.models.ElasticSans; + +public final class ElasticSansImpl implements ElasticSans { + private static final ClientLogger LOGGER = new ClientLogger(ElasticSansImpl.class); + + private final ElasticSansClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public ElasticSansImpl( + ElasticSansClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups) { + this.serviceClient().delete(resourceGroupName, elasticSanName, forceDeleteVolumeGroups); + } + + public void delete(String resourceGroupName, String elasticSanName) { + this.serviceClient().delete(resourceGroupName, elasticSanName); + } + + public void delete( + String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context) { + this.serviceClient().delete(resourceGroupName, elasticSanName, forceDeleteVolumeGroups, context); + } + + public ElasticSan getByResourceGroup(String resourceGroupName, String elasticSanName) { + ElasticSanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, elasticSanName); + if (inner != null) { + return new ElasticSanImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String elasticSanName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, elasticSanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ElasticSanImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ElasticSan 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, elasticSanName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, elasticSanName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + Boolean localForceDeleteVolumeGroups = null; + this.delete(resourceGroupName, elasticSanName, localForceDeleteVolumeGroups, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDeleteVolumeGroups, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + this.delete(resourceGroupName, elasticSanName, forceDeleteVolumeGroups, context); + } + + private ElasticSansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + public ElasticSanImpl define(String name) { + return new ElasticSanImpl(name, this.manager()); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..116f9e542908e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.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.elasticsan.fluent.OperationsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationListResult; +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 ElasticSanManagementImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ElasticSanManagementImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ElasticSan/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan 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(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan 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(), null, null)); + } + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); + } + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context)); + } + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..65ef49da713b0 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/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.elasticsan.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.elasticsan.fluent.OperationsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; +import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation; +import com.azure.resourcemanager.elasticsan.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.elasticsan.ElasticSanManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ElasticSanRPOperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ElasticSanRPOperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.java new file mode 100644 index 0000000000000..968ea53a0b771 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.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.elasticsan.implementation; + +import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner; +import com.azure.resourcemanager.elasticsan.models.ResourceTypeSku; +import com.azure.resourcemanager.elasticsan.models.SanTierInfo; +import com.azure.resourcemanager.elasticsan.models.Sku; +import com.azure.resourcemanager.elasticsan.models.SkuLocationInfo; +import com.azure.resourcemanager.elasticsan.models.VolumeGroupTierInfo; +import com.azure.resourcemanager.elasticsan.models.VolumeTierInfo; +import java.util.Collections; +import java.util.List; + +public final class ResourceTypeSkuImpl implements ResourceTypeSku { + private ResourceTypeSkuInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + ResourceTypeSkuImpl( + ResourceTypeSkuInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SanTierInfo san() { + return this.innerModel().san(); + } + + public VolumeGroupTierInfo volumeGroup() { + return this.innerModel().volumeGroup(); + } + + public VolumeTierInfo volume() { + return this.innerModel().volume(); + } + + public ResourceTypeSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..420eba8bd9e0f --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.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.elasticsan.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.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.elasticsan.fluent.SkusClient; +import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner; +import com.azure.resourcemanager.elasticsan.models.SkuInformationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(ElasticSanManagementImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementSkus to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + private interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.ElasticSan/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU Information objects along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + 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(), filter, accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU Information objects along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, 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(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU Information objects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @throws 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 SKU Information objects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU Information objects as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(filter, context)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @throws 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 SKU Information objects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(listAsync(filter)); + } + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 SKU Information objects as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(listAsync(filter, context)); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.java new file mode 100644 index 0000000000000..1344f14e951b4 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.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.elasticsan.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.elasticsan.fluent.SkusClient; +import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner; +import com.azure.resourcemanager.elasticsan.models.ResourceTypeSku; +import com.azure.resourcemanager.elasticsan.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceTypeSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return Utils.mapPage(inner, inner1 -> new ResourceTypeSkuImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/Utils.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/Utils.java new file mode 100644 index 0000000000000..c64a3fa8f585c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/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.elasticsan.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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupImpl.java new file mode 100644 index 0000000000000..9ba3cf0e6e610 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.VolumeGroup; +import com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate; +import java.util.Collections; +import java.util.Map; + +public final class VolumeGroupImpl implements VolumeGroup, VolumeGroup.Definition, VolumeGroup.Update { + private VolumeGroupInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + + public StorageTargetType protocolType() { + return this.innerModel().protocolType(); + } + + public EncryptionType encryption() { + return this.innerModel().encryption(); + } + + public NetworkRuleSet networkAcls() { + return this.innerModel().networkAcls(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VolumeGroupInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String elasticSanName; + + private String volumeGroupName; + + private VolumeGroupUpdate updateParameters; + + public VolumeGroupImpl withExistingElasticSan(String resourceGroupName, String elasticSanName) { + this.resourceGroupName = resourceGroupName; + this.elasticSanName = elasticSanName; + return this; + } + + public VolumeGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeGroups() + .create(resourceGroupName, elasticSanName, volumeGroupName, this.innerModel(), Context.NONE); + return this; + } + + public VolumeGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeGroups() + .create(resourceGroupName, elasticSanName, volumeGroupName, this.innerModel(), context); + return this; + } + + VolumeGroupImpl(String name, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = new VolumeGroupInner(); + this.serviceManager = serviceManager; + this.volumeGroupName = name; + } + + public VolumeGroupImpl update() { + this.updateParameters = new VolumeGroupUpdate(); + return this; + } + + public VolumeGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeGroups() + .update(resourceGroupName, elasticSanName, volumeGroupName, updateParameters, Context.NONE); + return this; + } + + public VolumeGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeGroups() + .update(resourceGroupName, elasticSanName, volumeGroupName, updateParameters, context); + return this; + } + + VolumeGroupImpl( + VolumeGroupInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.elasticSanName = Utils.getValueFromIdByName(innerObject.id(), "elasticSans"); + this.volumeGroupName = Utils.getValueFromIdByName(innerObject.id(), "volumegroups"); + } + + public VolumeGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeGroups() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, Context.NONE) + .getValue(); + return this; + } + + public VolumeGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeGroups() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, context) + .getValue(); + return this; + } + + public VolumeGroupImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VolumeGroupImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VolumeGroupImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VolumeGroupImpl withProtocolType(StorageTargetType protocolType) { + if (isInCreateMode()) { + this.innerModel().withProtocolType(protocolType); + return this; + } else { + this.updateParameters.withProtocolType(protocolType); + return this; + } + } + + public VolumeGroupImpl withEncryption(EncryptionType encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateParameters.withEncryption(encryption); + return this; + } + } + + public VolumeGroupImpl withNetworkAcls(NetworkRuleSet networkAcls) { + this.innerModel().withNetworkAcls(networkAcls); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java new file mode 100644 index 0000000000000..e0be78152e718 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java @@ -0,0 +1,1519 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.VolumeGroupsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; +import com.azure.resourcemanager.elasticsan.models.VolumeGroupList; +import com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate; +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 VolumeGroupsClient. */ +public final class VolumeGroupsClientImpl implements VolumeGroupsClient { + /** The proxy service used to perform REST calls. */ + private final VolumeGroupsService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of VolumeGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VolumeGroupsClientImpl(ElasticSanManagementImpl client) { + this.service = + RestProxy.create(VolumeGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementVolumeGroups to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + private interface VolumeGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumeGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByElasticSan( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumeGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumeGroupUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @HeaderParam("x-ms-delete-volumes") Boolean forceDeleteVolumes, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByElasticSanNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByElasticSanSinglePageAsync( + String resourceGroupName, String elasticSanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByElasticSan( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByElasticSanSinglePageAsync( + String resourceGroupName, String elasticSanName, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByElasticSan( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByElasticSanAsync(String resourceGroupName, String elasticSanName) { + return new PagedFlux<>( + () -> listByElasticSanSinglePageAsync(resourceGroupName, elasticSanName), + nextLink -> listByElasticSanNextSinglePageAsync(nextLink)); + } + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByElasticSanAsync( + String resourceGroupName, String elasticSanName, Context context) { + return new PagedFlux<>( + () -> listByElasticSanSinglePageAsync(resourceGroupName, elasticSanName, context), + nextLink -> listByElasticSanNextSinglePageAsync(nextLink, context)); + } + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName) { + return new PagedIterable<>(listByElasticSanAsync(resourceGroupName, elasticSanName)); + } + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByElasticSan( + String resourceGroupName, String elasticSanName, Context context) { + return new PagedIterable<>(listByElasticSanAsync(resourceGroupName, elasticSanName, context)); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName 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 + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName 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 + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeGroupInner> beginCreateAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VolumeGroupInner.class, + VolumeGroupInner.class, + this.client.getContext()); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeGroupInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeGroupInner.class, VolumeGroupInner.class, context); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeGroupInner> beginCreate( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).getSyncPoller(); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeGroupInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeGroupInner create( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters) { + return createAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).block(); + } + + /** + * Create a Volume Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeGroupInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupInner parameters, + Context context) { + return createAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context).block(); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeGroupInner> beginUpdateAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + VolumeGroupInner.class, + VolumeGroupInner.class, + this.client.getContext()); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeGroupInner> beginUpdateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeGroupInner.class, VolumeGroupInner.class, context); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeGroupInner> beginUpdate( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).getSyncPoller(); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeGroupInner> beginUpdate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeGroupInner update( + String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters) { + return updateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).block(); + } + + /** + * Update an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param parameters Volume Group object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume Group request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeGroupInner update( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + VolumeGroupUpdate parameters, + Context context) { + return updateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context).block(); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + forceDeleteVolumes, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + forceDeleteVolumes, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes).getSyncPoller(); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes, context) + .getSyncPoller(); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 elasticSanName, String volumeGroupName) { + final Boolean forceDeleteVolumes = null; + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes) { + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes).block(); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 elasticSanName, String volumeGroupName) { + final Boolean forceDeleteVolumes = null; + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes).block(); + } + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context) { + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes, context).block(); + } + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String elasticSanName, String volumeGroupName) { + return getWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeGroupInner get(String resourceGroupName, String elasticSanName, String volumeGroupName) { + return getAsync(resourceGroupName, elasticSanName, volumeGroupName).block(); + } + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 Volume Groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByElasticSanNextSinglePageAsync(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.listByElasticSanNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volume Groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByElasticSanNextSinglePageAsync( + 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 + .listByElasticSanNext(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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsImpl.java new file mode 100644 index 0000000000000..8b0acff794129 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsImpl.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.VolumeGroupsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; +import com.azure.resourcemanager.elasticsan.models.VolumeGroup; +import com.azure.resourcemanager.elasticsan.models.VolumeGroups; + +public final class VolumeGroupsImpl implements VolumeGroups { + private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupsImpl.class); + + private final VolumeGroupsClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public VolumeGroupsImpl( + VolumeGroupsClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName) { + PagedIterable inner = + this.serviceClient().listByElasticSan(resourceGroupName, elasticSanName); + return Utils.mapPage(inner, inner1 -> new VolumeGroupImpl(inner1, this.manager())); + } + + public PagedIterable listByElasticSan( + String resourceGroupName, String elasticSanName, Context context) { + PagedIterable inner = + this.serviceClient().listByElasticSan(resourceGroupName, elasticSanName, context); + return Utils.mapPage(inner, inner1 -> new VolumeGroupImpl(inner1, this.manager())); + } + + public void delete( + String resourceGroupName, String elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes); + } + + public void delete(String resourceGroupName, String elasticSanName, String volumeGroupName) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName); + } + + public void delete( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes, context); + } + + public VolumeGroup get(String resourceGroupName, String elasticSanName, String volumeGroupName) { + VolumeGroupInner inner = this.serviceClient().get(resourceGroupName, elasticSanName, volumeGroupName); + if (inner != null) { + return new VolumeGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VolumeGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VolumeGroup 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + return this.getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + return this.getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + Boolean localForceDeleteVolumes = null; + this.delete(resourceGroupName, elasticSanName, volumeGroupName, localForceDeleteVolumes, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Boolean forceDeleteVolumes, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + this.delete(resourceGroupName, elasticSanName, volumeGroupName, forceDeleteVolumes, context); + } + + private VolumeGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + public VolumeGroupImpl define(String name) { + return new VolumeGroupImpl(name, this.manager()); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeImpl.java new file mode 100644 index 0000000000000..b252f6834381a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; +import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo; +import com.azure.resourcemanager.elasticsan.models.SourceCreationData; +import com.azure.resourcemanager.elasticsan.models.Volume; +import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; +import java.util.Collections; +import java.util.Map; + +public final class VolumeImpl implements Volume, Volume.Definition, Volume.Update { + private VolumeInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String volumeId() { + return this.innerModel().volumeId(); + } + + public SourceCreationData creationData() { + return this.innerModel().creationData(); + } + + public Long sizeGiB() { + return this.innerModel().sizeGiB(); + } + + public IscsiTargetInfo storageTarget() { + return this.innerModel().storageTarget(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public VolumeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String elasticSanName; + + private String volumeGroupName; + + private String volumeName; + + private VolumeUpdate updateParameters; + + public VolumeImpl withExistingVolumegroup(String resourceGroupName, String elasticSanName, String volumeGroupName) { + this.resourceGroupName = resourceGroupName; + this.elasticSanName = elasticSanName; + this.volumeGroupName = volumeGroupName; + return this; + } + + public Volume create() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .create( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, this.innerModel(), Context.NONE); + return this; + } + + public Volume create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .create(resourceGroupName, elasticSanName, volumeGroupName, volumeName, this.innerModel(), context); + return this; + } + + VolumeImpl(String name, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = new VolumeInner(); + this.serviceManager = serviceManager; + this.volumeName = name; + } + + public VolumeImpl update() { + this.updateParameters = new VolumeUpdate(); + return this; + } + + public Volume apply() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .update(resourceGroupName, elasticSanName, volumeGroupName, volumeName, updateParameters, Context.NONE); + return this; + } + + public Volume apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .update(resourceGroupName, elasticSanName, volumeGroupName, volumeName, updateParameters, context); + return this; + } + + VolumeImpl(VolumeInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.elasticSanName = Utils.getValueFromIdByName(innerObject.id(), "elasticSans"); + this.volumeGroupName = Utils.getValueFromIdByName(innerObject.id(), "volumegroups"); + this.volumeName = Utils.getValueFromIdByName(innerObject.id(), "volumes"); + } + + public Volume refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, volumeName, Context.NONE) + .getValue(); + return this; + } + + public Volume refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumes() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) + .getValue(); + return this; + } + + public VolumeImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public VolumeImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public VolumeImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateParameters.withTags(tags); + return this; + } + } + + public VolumeImpl withCreationData(SourceCreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } + + public VolumeImpl withSizeGiB(Long sizeGiB) { + if (isInCreateMode()) { + this.innerModel().withSizeGiB(sizeGiB); + return this; + } else { + this.updateParameters.withSizeGiB(sizeGiB); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesClientImpl.java new file mode 100644 index 0000000000000..a4ba8d0f79a15 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesClientImpl.java @@ -0,0 +1,1585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.VolumesClient; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; +import com.azure.resourcemanager.elasticsan.models.VolumeList; +import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; +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 VolumesClient. */ +public final class VolumesClientImpl implements VolumesClient { + /** The proxy service used to perform REST calls. */ + private final VolumesService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of VolumesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VolumesClientImpl(ElasticSanManagementImpl client) { + this.service = RestProxy.create(VolumesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementVolumes to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + private interface VolumesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumeInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") VolumeUpdate parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @PathParam("volumeName") String volumeName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" + + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVolumeGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("volumeGroupName") String volumeGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByVolumeGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName 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 + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName 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 + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, this.client.getContext()); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, context); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) + .getSyncPoller(); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters) { + return createAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters).block(); + } + + /** + * Create a Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeInner parameters, + Context context) { + return createAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context).block(); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName 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(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeInner> beginUpdateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, this.client.getContext()); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, VolumeInner> beginUpdateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), VolumeInner.class, VolumeInner.class, context); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) + .getSyncPoller(); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of response for Volume request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, VolumeInner> beginUpdate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) + .getSyncPoller(); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner update( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters) { + return updateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters).block(); + } + + /** + * Update an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param parameters Volume object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for Volume request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner update( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + VolumeUpdate parameters, + Context context) { + return updateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context).block(); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, String volumeGroupName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, String volumeGroupName, String volumeName, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, String volumeGroupName, String volumeName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 elasticSanName, String volumeGroupName, String volumeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 elasticSanName, String volumeGroupName, String volumeName) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).getSyncPoller(); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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 elasticSanName, String volumeGroupName, String volumeName, Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) + .getSyncPoller(); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 elasticSanName, String volumeGroupName, String volumeName) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 elasticSanName, String volumeGroupName, String volumeName, Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 elasticSanName, String volumeGroupName, String volumeName) { + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).block(); + } + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 elasticSanName, String volumeGroupName, String volumeName, Context context) { + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context).block(); + } + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + if (volumeName == null) { + return Mono.error(new IllegalArgumentException("Parameter volumeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + return getWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VolumeInner get(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + return getAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).block(); + } + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { + return getWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context).block(); + } + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVolumeGroupSinglePageAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByVolumeGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVolumeGroupSinglePageAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, 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 (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + if (volumeGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter volumeGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByVolumeGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + volumeGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVolumeGroupAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + return new PagedFlux<>( + () -> listByVolumeGroupSinglePageAsync(resourceGroupName, elasticSanName, volumeGroupName), + nextLink -> listByVolumeGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVolumeGroupAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context) { + return new PagedFlux<>( + () -> listByVolumeGroupSinglePageAsync(resourceGroupName, elasticSanName, volumeGroupName, context), + nextLink -> listByVolumeGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + return new PagedIterable<>(listByVolumeGroupAsync(resourceGroupName, elasticSanName, volumeGroupName)); + } + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context) { + return new PagedIterable<>(listByVolumeGroupAsync(resourceGroupName, elasticSanName, volumeGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 Volumes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVolumeGroupNextSinglePageAsync(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.listByVolumeGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Volumes along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVolumeGroupNextSinglePageAsync(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 + .listByVolumeGroupNext(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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesImpl.java new file mode 100644 index 0000000000000..f426d5b03620f --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumesImpl.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.elasticsan.fluent.VolumesClient; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; +import com.azure.resourcemanager.elasticsan.models.Volume; +import com.azure.resourcemanager.elasticsan.models.Volumes; + +public final class VolumesImpl implements Volumes { + private static final ClientLogger LOGGER = new ClientLogger(VolumesImpl.class); + + private final VolumesClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public VolumesImpl( + VolumesClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName); + } + + public void delete( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + } + + public Volume get(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + VolumeInner inner = this.serviceClient().get(resourceGroupName, elasticSanName, volumeGroupName, volumeName); + if (inner != null) { + return new VolumeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VolumeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + PagedIterable inner = + this.serviceClient().listByVolumeGroup(resourceGroupName, elasticSanName, volumeGroupName); + return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByVolumeGroup(resourceGroupName, elasticSanName, volumeGroupName, context); + return Utils.mapPage(inner, inner1 -> new VolumeImpl(inner1, this.manager())); + } + + public Volume 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, volumeName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + return this.getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, volumeName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName, 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 elasticSanName = Utils.getValueFromIdByName(id, "elasticSans"); + if (elasticSanName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id))); + } + String volumeGroupName = Utils.getValueFromIdByName(id, "volumegroups"); + if (volumeGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumegroups'.", id))); + } + String volumeName = Utils.getValueFromIdByName(id, "volumes"); + if (volumeName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); + } + this.delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + } + + private VolumesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + public VolumeImpl define(String name) { + return new VolumeImpl(name, this.manager()); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/package-info.java new file mode 100644 index 0000000000000..37cbc36c98c0c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ElasticSanManagement. null. */ +package com.azure.resourcemanager.elasticsan.implementation; diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Action.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Action.java new file mode 100644 index 0000000000000..d941785bca3d2 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Action.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.elasticsan.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for Action. */ +public enum Action { + /** Enum value Allow. */ + ALLOW("Allow"); + + /** The actual serialized value for a Action instance. */ + private final String value; + + Action(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Action instance. + * + * @param value the serialized value to parse. + * @return the parsed Action object, or null if unable to parse. + */ + @JsonCreator + public static Action fromString(String value) { + Action[] items = Action.values(); + for (Action item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSan.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSan.java new file mode 100644 index 0000000000000..45e43e90b284c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSan.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of ElasticSan. */ +public interface ElasticSan { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the sku property: resource sku. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the availabilityZones property: Logical zone for Elastic San resource; example: ["1"]. + * + * @return the availabilityZones value. + */ + List availabilityZones(); + + /** + * Gets the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + + /** + * Gets the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @return the baseSizeTiB value. + */ + long baseSizeTiB(); + + /** + * Gets the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @return the extendedCapacitySizeTiB value. + */ + long extendedCapacitySizeTiB(); + + /** + * Gets the totalVolumeSizeGiB property: Total size of the provisioned Volumes in GiB. + * + * @return the totalVolumeSizeGiB value. + */ + Long totalVolumeSizeGiB(); + + /** + * Gets the volumeGroupCount property: Total number of volume groups in this Elastic San appliance. + * + * @return the volumeGroupCount value. + */ + Long volumeGroupCount(); + + /** + * Gets the totalIops property: Total Provisioned IOPS of the Elastic San appliance. + * + * @return the totalIops value. + */ + Long totalIops(); + + /** + * Gets the totalMBps property: Total Provisioned MBps Elastic San appliance. + * + * @return the totalMBps value. + */ + Long totalMBps(); + + /** + * Gets the provisionedMBps property: Provisioned MBps Elastic San appliance. + * + * @return the provisionedMBps value. + */ + Long provisionedMBps(); + + /** + * 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.elasticsan.fluent.models.ElasticSanInner object. + * + * @return the inner object. + */ + ElasticSanInner innerModel(); + + /** The entirety of the ElasticSan definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ElasticSan definition stages. */ + interface DefinitionStages { + /** The first stage of the ElasticSan definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ElasticSan definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the ElasticSan definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the ElasticSan 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.WithSku, + DefinitionStages.WithAvailabilityZones, + DefinitionStages.WithBaseSizeTiB, + DefinitionStages.WithExtendedCapacitySizeTiB { + /** + * Executes the create request. + * + * @return the created resource. + */ + ElasticSan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ElasticSan create(Context context); + } + /** The stage of the ElasticSan 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 ElasticSan definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: resource sku. + * + * @param sku resource sku. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the ElasticSan definition allowing to specify availabilityZones. */ + interface WithAvailabilityZones { + /** + * Specifies the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].. + * + * @param availabilityZones Logical zone for Elastic San resource; example: ["1"]. + * @return the next definition stage. + */ + WithCreate withAvailabilityZones(List availabilityZones); + } + /** The stage of the ElasticSan definition allowing to specify baseSizeTiB. */ + interface WithBaseSizeTiB { + /** + * Specifies the baseSizeTiB property: Base size of the Elastic San appliance in TiB.. + * + * @param baseSizeTiB Base size of the Elastic San appliance in TiB. + * @return the next definition stage. + */ + WithCreate withBaseSizeTiB(long baseSizeTiB); + } + /** The stage of the ElasticSan definition allowing to specify extendedCapacitySizeTiB. */ + interface WithExtendedCapacitySizeTiB { + /** + * Specifies the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.. + * + * @param extendedCapacitySizeTiB Extended size of the Elastic San appliance in TiB. + * @return the next definition stage. + */ + WithCreate withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB); + } + } + /** + * Begins update for the ElasticSan resource. + * + * @return the stage of resource update. + */ + ElasticSan.Update update(); + + /** The template for ElasticSan update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ElasticSan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ElasticSan apply(Context context); + } + /** The ElasticSan update stages. */ + interface UpdateStages { + /** The stage of the ElasticSan update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Update tags. + * + * @param tags Update tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ElasticSan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ElasticSan refresh(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java new file mode 100644 index 0000000000000..b1474a3bc298c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Elastic Sans. */ +@Fluent +public final class ElasticSanList { + /* + * An array of Elastic San objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of Elastic San objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of Elastic San objects. + * + * @param value the value value to set. + * @return the ElasticSanList object itself. + */ + public ElasticSanList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ElasticSanList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanList.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java new file mode 100644 index 0000000000000..975b15f20c976 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Metadata about an operation. */ +@Fluent +public final class ElasticSanOperationDisplay { + /* + * Localized friendly form of the resource provider name. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /* + * Localized friendly form of the resource type related to this + * action/operation. + */ + @JsonProperty(value = "resource", required = true) + private String resource; + + /* + * Localized friendly name for the operation, as it should be shown to the + * user. + */ + @JsonProperty(value = "operation", required = true) + private String operation; + + /* + * Localized friendly description for the operation, as it should be shown + * to the user. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /** + * Get the provider property: Localized friendly form of the resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Localized friendly form of the resource provider name. + * + * @param provider the provider value to set. + * @return the ElasticSanOperationDisplay object itself. + */ + public ElasticSanOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Localized friendly form of the resource type related to this action/operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Localized friendly form of the resource type related to this action/operation. + * + * @param resource the resource value to set. + * @return the ElasticSanOperationDisplay object itself. + */ + public ElasticSanOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Localized friendly name for the operation, as it should be shown to the user. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for the operation, as it should be shown to the user. + * + * @param operation the operation value to set. + * @return the ElasticSanOperationDisplay object itself. + */ + public ElasticSanOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Localized friendly description for the operation, as it should be shown to the + * user. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation, as it should be shown to the + * user. + * + * @param description the description value to set. + * @return the ElasticSanOperationDisplay object itself. + */ + public ElasticSanOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provider() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property provider in model ElasticSanOperationDisplay")); + } + if (resource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resource in model ElasticSanOperationDisplay")); + } + if (operation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property operation in model ElasticSanOperationDisplay")); + } + if (description() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model ElasticSanOperationDisplay")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanOperationDisplay.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.java new file mode 100644 index 0000000000000..35d6a5f2a91f8 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.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.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of operations supported by the RP. */ +@Fluent +public final class ElasticSanOperationListResult { + /* + * An array of operations supported by the ElasticSan RP. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: An array of operations supported by the ElasticSan RP. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of operations supported by the ElasticSan RP. + * + * @param value the value value to set. + * @return the ElasticSanOperationListResult object itself. + */ + public ElasticSanOperationListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URI to fetch the next section of the paginated response. + * + * @param nextLink the nextLink value to set. + * @return the ElasticSanOperationListResult object itself. + */ + public ElasticSanOperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ElasticSanOperationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ElasticSanOperationListResult.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.java new file mode 100644 index 0000000000000..c86413f2707fd --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.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.elasticsan.models; + +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; + +/** An immutable client-side representation of ElasticSanRPOperation. */ +public interface ElasticSanRPOperation { + /** + * Gets the name property: The name of the operation being performed on this particular object. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation applies to data-plane. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Additional metadata about RP operation. + * + * @return the display value. + */ + ElasticSanOperationDisplay display(); + + /** + * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner object. + * + * @return the inner object. + */ + ElasticSanRPOperationInner innerModel(); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanUpdate.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanUpdate.java new file mode 100644 index 0000000000000..89c575fbc9e13 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanUpdate.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Response for ElasticSan update request. */ +@Fluent +public final class ElasticSanUpdate { + /* + * Properties of ElasticSan. + */ + @JsonProperty(value = "properties") + private ElasticSanUpdateProperties innerProperties; + + /* + * Update tags + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the innerProperties property: Properties of ElasticSan. + * + * @return the innerProperties value. + */ + private ElasticSanUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Update tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Update tags. + * + * @param tags the tags value to set. + * @return the ElasticSanUpdate object itself. + */ + public ElasticSanUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @return the baseSizeTiB value. + */ + public Long baseSizeTiB() { + return this.innerProperties() == null ? null : this.innerProperties().baseSizeTiB(); + } + + /** + * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB. + * + * @param baseSizeTiB the baseSizeTiB value to set. + * @return the ElasticSanUpdate object itself. + */ + public ElasticSanUpdate withBaseSizeTiB(Long baseSizeTiB) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanUpdateProperties(); + } + this.innerProperties().withBaseSizeTiB(baseSizeTiB); + return this; + } + + /** + * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @return the extendedCapacitySizeTiB value. + */ + public Long extendedCapacitySizeTiB() { + return this.innerProperties() == null ? null : this.innerProperties().extendedCapacitySizeTiB(); + } + + /** + * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB. + * + * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set. + * @return the ElasticSanUpdate object itself. + */ + public ElasticSanUpdate withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanUpdateProperties(); + } + this.innerProperties().withExtendedCapacitySizeTiB(extendedCapacitySizeTiB); + 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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSans.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSans.java new file mode 100644 index 0000000000000..7ae9e783688f8 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSans.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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 ElasticSans. */ +public interface ElasticSans { + /** + * Gets a list of ElasticSans 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 a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of ElasticSans in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of ElasticSan in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume Groups. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, Boolean forceDeleteVolumeGroups); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName); + + /** + * Delete a Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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. + */ + void delete(String resourceGroupName, String elasticSanName, Boolean forceDeleteVolumeGroups, Context context); + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan. + */ + ElasticSan getByResourceGroup(String resourceGroupName, String elasticSanName); + + /** + * Get a ElasticSan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a ElasticSan along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String elasticSanName, Context context); + + /** + * Get a ElasticSan. + * + * @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 ElasticSan along with {@link Response}. + */ + ElasticSan getById(String id); + + /** + * Get a ElasticSan. + * + * @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 ElasticSan along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Elastic San. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Elastic San. + * + * @param id the resource ID. + * @param forceDeleteVolumeGroups Required if the San has associated Volume 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. + */ + void deleteByIdWithResponse(String id, Boolean forceDeleteVolumeGroups, Context context); + + /** + * Begins definition for a new ElasticSan resource. + * + * @param name resource name. + * @return the first stage of the new ElasticSan definition. + */ + ElasticSan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionType.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionType.java new file mode 100644 index 0000000000000..46e2ccebefb56 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionType. */ +public final class EncryptionType extends ExpandableStringEnum { + /** Static value EncryptionAtRestWithPlatformKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = + fromString("EncryptionAtRestWithPlatformKey"); + + /** Static value EncryptionAtRestWithCustomerKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_KEY = + fromString("EncryptionAtRestWithCustomerKey"); + + /** Static value EncryptionAtRestWithPlatformAndCustomerKeys for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_AND_CUSTOMER_KEYS = + fromString("EncryptionAtRestWithPlatformAndCustomerKeys"); + + /** + * Creates or finds a EncryptionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionType. + */ + @JsonCreator + public static EncryptionType fromString(String name) { + return fromString(name, EncryptionType.class); + } + + /** @return known EncryptionType values. */ + public static Collection values() { + return values(EncryptionType.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IscsiTargetInfo.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IscsiTargetInfo.java new file mode 100644 index 0000000000000..c932dbc827606 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IscsiTargetInfo.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Iscsi target information. */ +@Fluent +public final class IscsiTargetInfo { + /* + * iSCSI Target IQN (iSCSI Qualified Name); example: + * "iqn.2005-03.org.iscsi:server". + */ + @JsonProperty(value = "targetIqn", access = JsonProperty.Access.WRITE_ONLY) + private String targetIqn; + + /* + * iSCSI Target Portal Host Name + */ + @JsonProperty(value = "targetPortalHostname", access = JsonProperty.Access.WRITE_ONLY) + private String targetPortalHostname; + + /* + * iSCSI Target Portal Port + */ + @JsonProperty(value = "targetPortalPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer targetPortalPort; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Operational status of the iSCSI Target. + */ + @JsonProperty(value = "status") + private OperationalStatus status; + + /** + * Get the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server". + * + * @return the targetIqn value. + */ + public String targetIqn() { + return this.targetIqn; + } + + /** + * Get the targetPortalHostname property: iSCSI Target Portal Host Name. + * + * @return the targetPortalHostname value. + */ + public String targetPortalHostname() { + return this.targetPortalHostname; + } + + /** + * Get the targetPortalPort property: iSCSI Target Portal Port. + * + * @return the targetPortalPort value. + */ + public Integer targetPortalPort() { + return this.targetPortalPort; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Operational status of the iSCSI Target. + * + * @return the status value. + */ + public OperationalStatus status() { + return this.status; + } + + /** + * Set the status property: Operational status of the iSCSI Target. + * + * @param status the status value to set. + * @return the IscsiTargetInfo object itself. + */ + public IscsiTargetInfo withStatus(OperationalStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Name.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Name.java new file mode 100644 index 0000000000000..db60f071703f1 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Name.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.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Name. */ +public final class Name extends ExpandableStringEnum { + /** Static value Standard_LRS for Name. */ + public static final Name STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for Name. */ + public static final Name PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value Standard_ZRS for Name. */ + public static final Name STANDARD_ZRS = fromString("Standard_ZRS"); + + /** + * Creates or finds a Name from its string representation. + * + * @param name a name to look for. + * @return the corresponding Name. + */ + @JsonCreator + public static Name fromString(String name) { + return fromString(name, Name.class); + } + + /** @return known Name values. */ + public static Collection values() { + return values(Name.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/NetworkRuleSet.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/NetworkRuleSet.java new file mode 100644 index 0000000000000..fe5e99631d6cb --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/NetworkRuleSet.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.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A set of rules governing the network accessibility. */ +@Fluent +public final class NetworkRuleSet { + /* + * The list of virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * Get the virtualNetworkRules property: The list of virtual network rules. + * + * @return the virtualNetworkRules value. + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtualNetworkRules property: The list of virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set. + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkRules() != null) { + virtualNetworkRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java new file mode 100644 index 0000000000000..11811e7cd586d --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.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.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationalStatus. */ +public final class OperationalStatus extends ExpandableStringEnum { + /** Static value Invalid for OperationalStatus. */ + public static final OperationalStatus INVALID = fromString("Invalid"); + + /** Static value Unknown for OperationalStatus. */ + public static final OperationalStatus UNKNOWN = fromString("Unknown"); + + /** Static value Healthy for OperationalStatus. */ + public static final OperationalStatus HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for OperationalStatus. */ + public static final OperationalStatus UNHEALTHY = fromString("Unhealthy"); + + /** Static value Updating for OperationalStatus. */ + public static final OperationalStatus UPDATING = fromString("Updating"); + + /** Static value Running for OperationalStatus. */ + public static final OperationalStatus RUNNING = fromString("Running"); + + /** Static value Stopped for OperationalStatus. */ + public static final OperationalStatus STOPPED = fromString("Stopped"); + + /** Static value Stopped (deallocated) for OperationalStatus. */ + public static final OperationalStatus STOPPED_DEALLOCATED = fromString("Stopped (deallocated)"); + + /** + * Creates or finds a OperationalStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationalStatus. + */ + @JsonCreator + public static OperationalStatus fromString(String name) { + return fromString(name, OperationalStatus.class); + } + + /** @return known OperationalStatus values. */ + public static Collection values() { + return values(OperationalStatus.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operations.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operations.java new file mode 100644 index 0000000000000..de222668bd6e0 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operations.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.elasticsan.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of ElasticSan 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 a list of ElasticSan operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.java new file mode 100644 index 0000000000000..5da497b04ae89 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.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.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningStates. */ +public final class ProvisioningStates extends ExpandableStringEnum { + /** Static value Invalid for ProvisioningStates. */ + public static final ProvisioningStates INVALID = fromString("Invalid"); + + /** Static value Succeeded for ProvisioningStates. */ + public static final ProvisioningStates SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningStates. */ + public static final ProvisioningStates FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningStates. */ + public static final ProvisioningStates CANCELED = fromString("Canceled"); + + /** Static value Pending for ProvisioningStates. */ + public static final ProvisioningStates PENDING = fromString("Pending"); + + /** Static value Creating for ProvisioningStates. */ + public static final ProvisioningStates CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningStates. */ + public static final ProvisioningStates UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningStates. */ + public static final ProvisioningStates DELETING = fromString("Deleting"); + + /** + * Creates or finds a ProvisioningStates from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningStates. + */ + @JsonCreator + public static ProvisioningStates fromString(String name) { + return fromString(name, ProvisioningStates.class); + } + + /** @return known ProvisioningStates values. */ + public static Collection values() { + return values(ProvisioningStates.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ResourceTypeSku.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ResourceTypeSku.java new file mode 100644 index 0000000000000..823bce9820365 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ResourceTypeSku.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.elasticsan.models; + +import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner; +import java.util.List; + +/** An immutable client-side representation of ResourceTypeSku. */ +public interface ResourceTypeSku { + /** + * Gets the sku property: The Sku tier. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the locationInfo property: Availability of the SKU for the location/zone. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the san property: Scalability targets for the San account for a given tier. + * + * @return the san value. + */ + SanTierInfo san(); + + /** + * Gets the volumeGroup property: Volume Group targets for the San account for a given tier. + * + * @return the volumeGroup value. + */ + VolumeGroupTierInfo volumeGroup(); + + /** + * Gets the volume property: Volume targets for the San account for a given tier. + * + * @return the volume value. + */ + VolumeTierInfo volume(); + + /** + * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner object. + * + * @return the inner object. + */ + ResourceTypeSkuInner innerModel(); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SanTierInfo.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SanTierInfo.java new file mode 100644 index 0000000000000..6da54bcf94c78 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SanTierInfo.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** San scalability target. */ +@Immutable +public final class SanTierInfo { + /* + * Maximum San account capacity in TiB + */ + @JsonProperty(value = "maxSizeTiB", access = JsonProperty.Access.WRITE_ONLY) + private Long maxSizeTiB; + + /* + * Minimum San account capacity in TiB + */ + @JsonProperty(value = "minSizeTiB", access = JsonProperty.Access.WRITE_ONLY) + private Long minSizeTiB; + + /* + * Increment the San capacity in TiB + */ + @JsonProperty(value = "minIncrementSizeTiB", access = JsonProperty.Access.WRITE_ONLY) + private Long minIncrementSizeTiB; + + /* + * Maximum IOPS per BaseTiB + */ + @JsonProperty(value = "iopsPerBaseTiB", access = JsonProperty.Access.WRITE_ONLY) + private Long iopsPerBaseTiB; + + /* + * Maximum MBps per BaseTiB + */ + @JsonProperty(value = "mbpsPerBaseTiB", access = JsonProperty.Access.WRITE_ONLY) + private Long mbpsPerBaseTiB; + + /* + * Maximum IOPS + */ + @JsonProperty(value = "maxIops", access = JsonProperty.Access.WRITE_ONLY) + private Long maxIops; + + /* + * Maximum MBps + */ + @JsonProperty(value = "maxMBps", access = JsonProperty.Access.WRITE_ONLY) + private Long maxMBps; + + /* + * Maximum number of volume groups per San account + */ + @JsonProperty(value = "maxVolumeGroupCount", access = JsonProperty.Access.WRITE_ONLY) + private Long maxVolumeGroupCount; + + /** + * Get the maxSizeTiB property: Maximum San account capacity in TiB. + * + * @return the maxSizeTiB value. + */ + public Long maxSizeTiB() { + return this.maxSizeTiB; + } + + /** + * Get the minSizeTiB property: Minimum San account capacity in TiB. + * + * @return the minSizeTiB value. + */ + public Long minSizeTiB() { + return this.minSizeTiB; + } + + /** + * Get the minIncrementSizeTiB property: Increment the San capacity in TiB. + * + * @return the minIncrementSizeTiB value. + */ + public Long minIncrementSizeTiB() { + return this.minIncrementSizeTiB; + } + + /** + * Get the iopsPerBaseTiB property: Maximum IOPS per BaseTiB. + * + * @return the iopsPerBaseTiB value. + */ + public Long iopsPerBaseTiB() { + return this.iopsPerBaseTiB; + } + + /** + * Get the mbpsPerBaseTiB property: Maximum MBps per BaseTiB. + * + * @return the mbpsPerBaseTiB value. + */ + public Long mbpsPerBaseTiB() { + return this.mbpsPerBaseTiB; + } + + /** + * Get the maxIops property: Maximum IOPS. + * + * @return the maxIops value. + */ + public Long maxIops() { + return this.maxIops; + } + + /** + * Get the maxMBps property: Maximum MBps. + * + * @return the maxMBps value. + */ + public Long maxMBps() { + return this.maxMBps; + } + + /** + * Get the maxVolumeGroupCount property: Maximum number of volume groups per San account. + * + * @return the maxVolumeGroupCount value. + */ + public Long maxVolumeGroupCount() { + return this.maxVolumeGroupCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Sku.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Sku.java new file mode 100644 index 0000000000000..6c250b798024e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Sku.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU name. Required for account creation; optional for update. */ +@Fluent +public final class Sku { + /* + * The sku name. + */ + @JsonProperty(value = "name") + private Name name; + + /* + * The sku tier. + */ + @JsonProperty(value = "tier") + private Tier tier; + + /** + * Get the name property: The sku name. + * + * @return the name value. + */ + public Name 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(Name name) { + this.name = name; + return this; + } + + /** + * Get the tier property: The sku tier. + * + * @return the tier value. + */ + public Tier 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(Tier tier) { + this.tier = tier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuInformationList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuInformationList.java new file mode 100644 index 0000000000000..70ab21f1967da --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuInformationList.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.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SKU Information objects. */ +@Immutable +public final class SkuInformationList { + /* + * List of ResourceType Sku + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Links to the next set of results + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: List of ResourceType Sku. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Links to 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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuLocationInfo.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuLocationInfo.java new file mode 100644 index 0000000000000..c61eaf5a87491 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuLocationInfo.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.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The location info. */ +@Immutable +public final class SkuLocationInfo { + /* + * The location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The zones. + */ + @JsonProperty(value = "zones", access = JsonProperty.Access.WRITE_ONLY) + private List zones; + + /** + * Get the location property: The location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the zones property: The zones. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Skus.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Skus.java new file mode 100644 index 0000000000000..e3059b003fb5d --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Skus.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * List all the available Skus in the region and information related to them. + * + * @throws com.azure.core.management.exception.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 SKU Information objects as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List all the available Skus in the region and information related to them. + * + * @param filter Specify $filter='location eq <location>' to filter on location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 SKU Information objects as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SourceCreationData.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SourceCreationData.java new file mode 100644 index 0000000000000..5c8d3cd794efb --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SourceCreationData.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.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data used when creating a disk. */ +@Fluent +public final class SourceCreationData { + /* + * This enumerates the possible sources of a volume creation. + */ + @JsonProperty(value = "createSource", required = true) + private VolumeCreateOption createSource; + + /* + * If createOption is Copy, this is the ARM id of the source snapshot or + * disk. If createOption is Restore, this is the ARM-like id of the source + * disk restore point. + */ + @JsonProperty(value = "sourceUri") + private String sourceUri; + + /** + * Get the createSource property: This enumerates the possible sources of a volume creation. + * + * @return the createSource value. + */ + public VolumeCreateOption createSource() { + return this.createSource; + } + + /** + * Set the createSource property: This enumerates the possible sources of a volume creation. + * + * @param createSource the createSource value to set. + * @return the SourceCreationData object itself. + */ + public SourceCreationData withCreateSource(VolumeCreateOption createSource) { + this.createSource = createSource; + return this; + } + + /** + * Get the sourceUri property: If createOption is Copy, this is the ARM id of the source snapshot or disk. If + * createOption is Restore, this is the ARM-like id of the source disk restore point. + * + * @return the sourceUri value. + */ + public String sourceUri() { + return this.sourceUri; + } + + /** + * Set the sourceUri property: If createOption is Copy, this is the ARM id of the source snapshot or disk. If + * createOption is Restore, this is the ARM-like id of the source disk restore point. + * + * @param sourceUri the sourceUri value to set. + * @return the SourceCreationData object itself. + */ + public SourceCreationData withSourceUri(String sourceUri) { + this.sourceUri = sourceUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (createSource() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property createSource in model SourceCreationData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SourceCreationData.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/State.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/State.java new file mode 100644 index 0000000000000..594f5406cff4a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/State.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.elasticsan.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for State. */ +public enum State { + /** Enum value provisioning. */ + PROVISIONING("provisioning"), + + /** Enum value deprovisioning. */ + DEPROVISIONING("deprovisioning"), + + /** Enum value succeeded. */ + SUCCEEDED("succeeded"), + + /** Enum value failed. */ + FAILED("failed"), + + /** Enum value networkSourceDeleted. */ + NETWORK_SOURCE_DELETED("networkSourceDeleted"); + + /** The actual serialized value for a State instance. */ + private final String value; + + State(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a State instance. + * + * @param value the serialized value to parse. + * @return the parsed State object, or null if unable to parse. + */ + @JsonCreator + public static State fromString(String value) { + State[] items = State.values(); + for (State item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java new file mode 100644 index 0000000000000..d25203ff13c58 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.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.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageTargetType. */ +public final class StorageTargetType extends ExpandableStringEnum { + /** Static value Iscsi for StorageTargetType. */ + public static final StorageTargetType ISCSI = fromString("Iscsi"); + + /** Static value None for StorageTargetType. */ + public static final StorageTargetType NONE = fromString("None"); + + /** + * Creates or finds a StorageTargetType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageTargetType. + */ + @JsonCreator + public static StorageTargetType fromString(String name) { + return fromString(name, StorageTargetType.class); + } + + /** @return known StorageTargetType values. */ + public static Collection values() { + return values(StorageTargetType.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Tier.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Tier.java new file mode 100644 index 0000000000000..643ae1c94a6e1 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Tier.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.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Tier. */ +public final class Tier extends ExpandableStringEnum { + /** Static value Hero for Tier. */ + public static final Tier HERO = fromString("Hero"); + + /** Static value Satellite for Tier. */ + public static final Tier SATELLITE = fromString("Satellite"); + + /** Static value Hub for Tier. */ + public static final Tier HUB = fromString("Hub"); + + /** + * Creates or finds a Tier from its string representation. + * + * @param name a name to look for. + * @return the corresponding Tier. + */ + @JsonCreator + public static Tier fromString(String name) { + return fromString(name, Tier.class); + } + + /** @return known Tier values. */ + public static Collection values() { + return values(Tier.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VirtualNetworkRule.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VirtualNetworkRule.java new file mode 100644 index 0000000000000..61557a910f1c7 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VirtualNetworkRule.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Network rule. */ +@Fluent +public final class VirtualNetworkRule { + /* + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /* + * The action of virtual network rule. + */ + @JsonProperty(value = "action") + private Action action; + + /* + * Gets the state of virtual network rule. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private State state; + + /** + * Get the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value. + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set the virtualNetworkResourceId property: Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + + /** + * Get the action property: The action of virtual network rule. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of virtual network rule. + * + * @param action the action value to set. + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get the state property: Gets the state of virtual network rule. + * + * @return the state value. + */ + public State state() { + return this.state; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualNetworkResourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualNetworkResourceId in model VirtualNetworkRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volume.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volume.java new file mode 100644 index 0000000000000..0482b35615e7e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volume.java @@ -0,0 +1,261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; +import java.util.Map; + +/** An immutable client-side representation of Volume. */ +public interface Volume { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the volumeId property: Unique Id of the volume in GUID format. + * + * @return the volumeId value. + */ + String volumeId(); + + /** + * Gets the creationData property: State of the operation on the resource. + * + * @return the creationData value. + */ + SourceCreationData creationData(); + + /** + * Gets the sizeGiB property: Volume size. + * + * @return the sizeGiB value. + */ + Long sizeGiB(); + + /** + * Gets the storageTarget property: Storage target information. + * + * @return the storageTarget value. + */ + IscsiTargetInfo storageTarget(); + + /** + * 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.elasticsan.fluent.models.VolumeInner object. + * + * @return the inner object. + */ + VolumeInner innerModel(); + + /** The entirety of the Volume definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The Volume definition stages. */ + interface DefinitionStages { + /** The first stage of the Volume definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Volume definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the Volume definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, elasticSanName, volumeGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @return the next definition stage. + */ + WithCreate withExistingVolumegroup(String resourceGroupName, String elasticSanName, String volumeGroupName); + } + /** + * The stage of the Volume 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.WithCreationData, DefinitionStages.WithSizeGiB { + /** + * Executes the create request. + * + * @return the created resource. + */ + Volume create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Volume create(Context context); + } + /** The stage of the Volume 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 Volume definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: State of the operation on the resource.. + * + * @param creationData State of the operation on the resource. + * @return the next definition stage. + */ + WithCreate withCreationData(SourceCreationData creationData); + } + /** The stage of the Volume definition allowing to specify sizeGiB. */ + interface WithSizeGiB { + /** + * Specifies the sizeGiB property: Volume size.. + * + * @param sizeGiB Volume size. + * @return the next definition stage. + */ + WithCreate withSizeGiB(Long sizeGiB); + } + } + /** + * Begins update for the Volume resource. + * + * @return the stage of resource update. + */ + Volume.Update update(); + + /** The template for Volume update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithSizeGiB { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Volume apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Volume apply(Context context); + } + /** The Volume update stages. */ + interface UpdateStages { + /** The stage of the Volume update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Volume update allowing to specify sizeGiB. */ + interface WithSizeGiB { + /** + * Specifies the sizeGiB property: Volume size.. + * + * @param sizeGiB Volume size. + * @return the next definition stage. + */ + Update withSizeGiB(Long sizeGiB); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Volume refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Volume refresh(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeCreateOption.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeCreateOption.java new file mode 100644 index 0000000000000..7365e6b997269 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeCreateOption.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.elasticsan.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for VolumeCreateOption. */ +public enum VolumeCreateOption { + /** Enum value None. */ + NONE("None"), + + /** Enum value FromVolume. */ + FROM_VOLUME("FromVolume"), + + /** Enum value FromDiskSnapshot. */ + FROM_DISK_SNAPSHOT("FromDiskSnapshot"), + + /** Enum value Export. */ + EXPORT("Export"); + + /** The actual serialized value for a VolumeCreateOption instance. */ + private final String value; + + VolumeCreateOption(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VolumeCreateOption instance. + * + * @param value the serialized value to parse. + * @return the parsed VolumeCreateOption object, or null if unable to parse. + */ + @JsonCreator + public static VolumeCreateOption fromString(String value) { + VolumeCreateOption[] items = VolumeCreateOption.values(); + for (VolumeCreateOption item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroup.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroup.java new file mode 100644 index 0000000000000..b5b853c07544c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroup.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; +import java.util.Map; + +/** An immutable client-side representation of VolumeGroup. */ +public interface VolumeGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Resource metadata required by ARM RPC. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + + /** + * Gets the protocolType property: Type of storage target. + * + * @return the protocolType value. + */ + StorageTargetType protocolType(); + + /** + * Gets the encryption property: Type of encryption. + * + * @return the encryption value. + */ + EncryptionType encryption(); + + /** + * Gets the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @return the networkAcls value. + */ + NetworkRuleSet networkAcls(); + + /** + * 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.elasticsan.fluent.models.VolumeGroupInner object. + * + * @return the inner object. + */ + VolumeGroupInner innerModel(); + + /** The entirety of the VolumeGroup definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The VolumeGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the VolumeGroup definition. */ + interface Blank extends WithLocation { + } + /** The stage of the VolumeGroup definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the VolumeGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, elasticSanName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @return the next definition stage. + */ + WithCreate withExistingElasticSan(String resourceGroupName, String elasticSanName); + } + /** + * The stage of the VolumeGroup 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.WithProtocolType, + DefinitionStages.WithEncryption, + DefinitionStages.WithNetworkAcls { + /** + * Executes the create request. + * + * @return the created resource. + */ + VolumeGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + VolumeGroup create(Context context); + } + /** The stage of the VolumeGroup 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 VolumeGroup definition allowing to specify protocolType. */ + interface WithProtocolType { + /** + * Specifies the protocolType property: Type of storage target. + * + * @param protocolType Type of storage target. + * @return the next definition stage. + */ + WithCreate withProtocolType(StorageTargetType protocolType); + } + /** The stage of the VolumeGroup definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Type of encryption. + * + * @param encryption Type of encryption. + * @return the next definition stage. + */ + WithCreate withEncryption(EncryptionType encryption); + } + /** The stage of the VolumeGroup definition allowing to specify networkAcls. */ + interface WithNetworkAcls { + /** + * Specifies the networkAcls property: A collection of rules governing the accessibility from specific + * network locations.. + * + * @param networkAcls A collection of rules governing the accessibility from specific network locations. + * @return the next definition stage. + */ + WithCreate withNetworkAcls(NetworkRuleSet networkAcls); + } + } + /** + * Begins update for the VolumeGroup resource. + * + * @return the stage of resource update. + */ + VolumeGroup.Update update(); + + /** The template for VolumeGroup update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProtocolType, UpdateStages.WithEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + VolumeGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + VolumeGroup apply(Context context); + } + /** The VolumeGroup update stages. */ + interface UpdateStages { + /** The stage of the VolumeGroup update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the VolumeGroup update allowing to specify protocolType. */ + interface WithProtocolType { + /** + * Specifies the protocolType property: Type of storage target. + * + * @param protocolType Type of storage target. + * @return the next definition stage. + */ + Update withProtocolType(StorageTargetType protocolType); + } + /** The stage of the VolumeGroup update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: Type of encryption. + * + * @param encryption Type of encryption. + * @return the next definition stage. + */ + Update withEncryption(EncryptionType encryption); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + VolumeGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + VolumeGroup refresh(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java new file mode 100644 index 0000000000000..6164b0807c4fe --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Volume Groups. */ +@Fluent +public final class VolumeGroupList { + /* + * An array of Volume Groups objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of Volume Groups objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of Volume Groups objects. + * + * @param value the value value to set. + * @return the VolumeGroupList object itself. + */ + public VolumeGroupList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VolumeGroupList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupList.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupTierInfo.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupTierInfo.java new file mode 100644 index 0000000000000..1597b1223a6b5 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupTierInfo.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.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume Group scalability target. */ +@Immutable +public final class VolumeGroupTierInfo { + /* + * Maximum number of Volumes per Volume Groups per San account + */ + @JsonProperty(value = "maxVolumeCount", access = JsonProperty.Access.WRITE_ONLY) + private Long maxVolumeCount; + + /** + * Get the maxVolumeCount property: Maximum number of Volumes per Volume Groups per San account. + * + * @return the maxVolumeCount value. + */ + public Long maxVolumeCount() { + return this.maxVolumeCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupUpdate.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupUpdate.java new file mode 100644 index 0000000000000..18db3dd342945 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupUpdate.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Volume Group request. */ +@Fluent +public final class VolumeGroupUpdate { + /* + * Properties of VolumeGroup. + */ + @JsonProperty(value = "properties") + private VolumeGroupUpdateProperties innerProperties; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the innerProperties property: Properties of VolumeGroup. + * + * @return the innerProperties value. + */ + private VolumeGroupUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VolumeGroupUpdate object itself. + */ + public VolumeGroupUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the protocolType property: Type of storage target. + * + * @return the protocolType value. + */ + public StorageTargetType protocolType() { + return this.innerProperties() == null ? null : this.innerProperties().protocolType(); + } + + /** + * Set the protocolType property: Type of storage target. + * + * @param protocolType the protocolType value to set. + * @return the VolumeGroupUpdate object itself. + */ + public VolumeGroupUpdate withProtocolType(StorageTargetType protocolType) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupUpdateProperties(); + } + this.innerProperties().withProtocolType(protocolType); + return this; + } + + /** + * Get the encryption property: Type of encryption. + * + * @return the encryption value. + */ + public EncryptionType encryption() { + return this.innerProperties() == null ? null : this.innerProperties().encryption(); + } + + /** + * Set the encryption property: Type of encryption. + * + * @param encryption the encryption value to set. + * @return the VolumeGroupUpdate object itself. + */ + public VolumeGroupUpdate withEncryption(EncryptionType encryption) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupUpdateProperties(); + } + this.innerProperties().withEncryption(encryption); + return this; + } + + /** + * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @return the networkAcls value. + */ + public NetworkRuleSet networkAcls() { + return this.innerProperties() == null ? null : this.innerProperties().networkAcls(); + } + + /** + * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations. + * + * @param networkAcls the networkAcls value to set. + * @return the VolumeGroupUpdate object itself. + */ + public VolumeGroupUpdate withNetworkAcls(NetworkRuleSet networkAcls) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupUpdateProperties(); + } + this.innerProperties().withNetworkAcls(networkAcls); + 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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroups.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroups.java new file mode 100644 index 0000000000000..80f9311f333ee --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroups.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.elasticsan.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 VolumeGroups. */ +public interface VolumeGroups { + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volume Groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName); + + /** + * List VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volume Groups as paginated response with {@link PagedIterable}. + */ + PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName, Context context); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName, Boolean forceDeleteVolumes); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName); + + /** + * Delete an VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, + String volumeGroupName, + Boolean forceDeleteVolumes, + Context context); + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups. + */ + VolumeGroup get(String resourceGroupName, String elasticSanName, String volumeGroupName); + + /** + * Get an VolumeGroups. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an VolumeGroups along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context); + + /** + * Get an VolumeGroups. + * + * @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 an VolumeGroups along with {@link Response}. + */ + VolumeGroup getById(String id); + + /** + * Get an VolumeGroups. + * + * @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 an VolumeGroups along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an VolumeGroup. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an VolumeGroup. + * + * @param id the resource ID. + * @param forceDeleteVolumes Required if the Volume Group has associated volumes. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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, Boolean forceDeleteVolumes, Context context); + + /** + * Begins definition for a new VolumeGroup resource. + * + * @param name resource name. + * @return the first stage of the new VolumeGroup definition. + */ + VolumeGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java new file mode 100644 index 0000000000000..a8fe150562c4a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Volumes. */ +@Fluent +public final class VolumeList { + /* + * An array of Volume objects. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: An array of Volume objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of Volume objects. + * + * @param value the value value to set. + * @return the VolumeList object itself. + */ + public VolumeList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model VolumeList")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeList.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeTierInfo.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeTierInfo.java new file mode 100644 index 0000000000000..85b42a9e459e3 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeTierInfo.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Volume scalability target. */ +@Immutable +public final class VolumeTierInfo { + /* + * Maximum volume capacity in GiB + */ + @JsonProperty(value = "maxSizeGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long maxSizeGiB; + + /* + * Minimum volume capacity in GiB + */ + @JsonProperty(value = "minSizeGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long minSizeGiB; + + /* + * Increment volume capacity in GiB + */ + @JsonProperty(value = "minIncrementSizeGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long minIncrementSizeGiB; + + /* + * Maximum IOPS per GiB + */ + @JsonProperty(value = "maxIopsPerGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long maxIopsPerGiB; + + /* + * Maximum MBps + */ + @JsonProperty(value = "maxMBpsPerGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long maxMBpsPerGiB; + + /* + * Maximum IOPS + */ + @JsonProperty(value = "maxIops", access = JsonProperty.Access.WRITE_ONLY) + private Long maxIops; + + /* + * Maximum MBps + */ + @JsonProperty(value = "maxMBps", access = JsonProperty.Access.WRITE_ONLY) + private Long maxMBps; + + /* + * Maximum number of connected clients count per Volume + */ + @JsonProperty(value = "maxConnectedClientCount", access = JsonProperty.Access.WRITE_ONLY) + private Long maxConnectedClientCount; + + /** + * Get the maxSizeGiB property: Maximum volume capacity in GiB. + * + * @return the maxSizeGiB value. + */ + public Long maxSizeGiB() { + return this.maxSizeGiB; + } + + /** + * Get the minSizeGiB property: Minimum volume capacity in GiB. + * + * @return the minSizeGiB value. + */ + public Long minSizeGiB() { + return this.minSizeGiB; + } + + /** + * Get the minIncrementSizeGiB property: Increment volume capacity in GiB. + * + * @return the minIncrementSizeGiB value. + */ + public Long minIncrementSizeGiB() { + return this.minIncrementSizeGiB; + } + + /** + * Get the maxIopsPerGiB property: Maximum IOPS per GiB. + * + * @return the maxIopsPerGiB value. + */ + public Long maxIopsPerGiB() { + return this.maxIopsPerGiB; + } + + /** + * Get the maxMBpsPerGiB property: Maximum MBps. + * + * @return the maxMBpsPerGiB value. + */ + public Long maxMBpsPerGiB() { + return this.maxMBpsPerGiB; + } + + /** + * Get the maxIops property: Maximum IOPS. + * + * @return the maxIops value. + */ + public Long maxIops() { + return this.maxIops; + } + + /** + * Get the maxMBps property: Maximum MBps. + * + * @return the maxMBps value. + */ + public Long maxMBps() { + return this.maxMBps; + } + + /** + * Get the maxConnectedClientCount property: Maximum number of connected clients count per Volume. + * + * @return the maxConnectedClientCount value. + */ + public Long maxConnectedClientCount() { + return this.maxConnectedClientCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeUpdate.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeUpdate.java new file mode 100644 index 0000000000000..ebd816f682758 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeUpdate.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.fluent.models.VolumeUpdateProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Response for Volume request. */ +@Fluent +public final class VolumeUpdate { + /* + * Properties of Volume. + */ + @JsonProperty(value = "properties") + private VolumeUpdateProperties innerProperties; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** + * Get the innerProperties property: Properties of Volume. + * + * @return the innerProperties value. + */ + private VolumeUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the VolumeUpdate object itself. + */ + public VolumeUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sizeGiB property: Volume size. + * + * @return the sizeGiB value. + */ + public Long sizeGiB() { + return this.innerProperties() == null ? null : this.innerProperties().sizeGiB(); + } + + /** + * Set the sizeGiB property: Volume size. + * + * @param sizeGiB the sizeGiB value to set. + * @return the VolumeUpdate object itself. + */ + public VolumeUpdate withSizeGiB(Long sizeGiB) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeUpdateProperties(); + } + this.innerProperties().withSizeGiB(sizeGiB); + 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/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volumes.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volumes.java new file mode 100644 index 0000000000000..a56f1e8b42c60 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Volumes.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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 Volumes. */ +public interface Volumes { + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName, String volumeName); + + /** + * Delete an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 elasticSanName, String volumeGroupName, String volumeName, Context context); + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume. + */ + Volume get(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName); + + /** + * Get an Volume. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param volumeName The name of the Volume. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Volume along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context); + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volumes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByVolumeGroup(String resourceGroupName, String elasticSanName, String volumeGroupName); + + /** + * List Volumes in a VolumeGroup. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param volumeGroupName The name of the VolumeGroup. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Volumes as paginated response with {@link PagedIterable}. + */ + PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, Context context); + + /** + * Get an Volume. + * + * @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 an Volume along with {@link Response}. + */ + Volume getById(String id); + + /** + * Get an Volume. + * + * @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 an Volume along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an Volume. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an Volume. + * + * @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 Volume resource. + * + * @param name resource name. + * @return the first stage of the new Volume definition. + */ + Volume.DefinitionStages.Blank define(String name); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/package-info.java new file mode 100644 index 0000000000000..41feccc3db17e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ElasticSanManagement. null. */ +package com.azure.resourcemanager.elasticsan.models; diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/package-info.java new file mode 100644 index 0000000000000..4d80b0291f50d --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ElasticSanManagement. null. */ +package com.azure.resourcemanager.elasticsan; diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/module-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/module-info.java new file mode 100644 index 0000000000000..1122e1dea7540 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/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.elasticsan { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.elasticsan; + exports com.azure.resourcemanager.elasticsan.fluent; + exports com.azure.resourcemanager.elasticsan.fluent.models; + exports com.azure.resourcemanager.elasticsan.models; + + opens com.azure.resourcemanager.elasticsan.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.elasticsan.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateSamples.java new file mode 100644 index 0000000000000..b97d16831411a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.resourcemanager.elasticsan.models.Name; +import com.azure.resourcemanager.elasticsan.models.Sku; +import com.azure.resourcemanager.elasticsan.models.Tier; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ElasticSans Create. */ +public final class ElasticSansCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .elasticSans() + .define("33zg-7s_4_7L2_65o") + .withRegion("aaaaaaaaaaaaaaaaaaaaaaaaa") + .withExistingResourceGroup("rgelasticsan") + .withTags(mapOf("key3875", "aaaaaaaaa")) + .withSku(new Sku().withName(Name.STANDARD_LRS).withTier(Tier.fromString("Standard"))) + .withAvailabilityZones(Arrays.asList("aaaaaaaaaaaaaaaaaaaaaaaaa")) + .withBaseSizeTiB(26L) + .withExtendedCapacitySizeTiB(4L) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteSamples.java new file mode 100644 index 0000000000000..b5222675a0bcf --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for ElasticSans Delete. */ +public final class ElasticSansDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().delete("rgelasticsan", "33zg-7s_4_7L2_65o", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().delete("rgelasticsan", "33zg-7s_4_7L2_65o", true, Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..9240d4ff29e6c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for ElasticSans GetByResourceGroup. */ +public final class ElasticSansGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().getByResourceGroupWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupSamples.java new file mode 100644 index 0000000000000..10945d3dc42c9 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for ElasticSans ListByResourceGroup. */ +public final class ElasticSansListByResourceGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansListByResourceGroupMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().listByResourceGroup("rgelasticsan", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListSamples.java new file mode 100644 index 0000000000000..fae0508c9f589 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for ElasticSans List. */ +public final class ElasticSansListSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansListBySubscriptionMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.elasticSans().list(Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansUpdateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansUpdateSamples.java new file mode 100644 index 0000000000000..4565b6b14110b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansUpdateSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.models.ElasticSan; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ElasticSans Update. */ +public final class ElasticSansUpdateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ElasticSans_Update_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void elasticSansUpdateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + ElasticSan resource = + manager + .elasticSans() + .getByResourceGroupWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key337", "aaaa")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/OperationsListSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..632cc88039850 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/OperationsListSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void operationsListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.operations().list(Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void operationsListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/SkusListSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/SkusListSamples.java new file mode 100644 index 0000000000000..05a6f5090fdb3 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/SkusListSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MinimumSet_Gen.json + */ + /** + * Sample code: Skus_List_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void skusListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.skus().list(null, Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MaximumSet_Gen.json + */ + /** + * Sample code: Skus_List_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void skusListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.skus().list("aaaaaaaaaaaa", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateSamples.java new file mode 100644 index 0000000000000..848820474e743 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.resourcemanager.elasticsan.models.Action; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VolumeGroups Create. */ +public final class VolumeGroupsCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .define("9_67U25-1f2gR3-b6L-4T5") + .withRegion((String) null) + .withExistingElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o") + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .define("9_67U25-1f2gR3-b6L-4T5") + .withRegion("aaaaaaaaaaaaaaaaaaaaaa") + .withExistingElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o") + .withTags(mapOf("key3582", "a")) + .withProtocolType(StorageTargetType.ISCSI) + .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .withNetworkAcls( + new NetworkRuleSet() + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule().withVirtualNetworkResourceId("aa").withAction(Action.ALLOW)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteSamples.java new file mode 100644 index 0000000000000..e67239886ed2a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for VolumeGroups Delete. */ +public final class VolumeGroupsDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", true, Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetSamples.java new file mode 100644 index 0000000000000..4b1a8a767c878 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for VolumeGroups Get. */ +public final class VolumeGroupsGetSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanSamples.java new file mode 100644 index 0000000000000..e2df819a11bba --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for VolumeGroups ListByElasticSan. */ +public final class VolumeGroupsListByElasticSanSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsListByElasticSanMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.volumeGroups().listByElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsListByElasticSanMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager.volumeGroups().listByElasticSan("rgelasticsan", "33zg-7s_4_7L2_65o", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsUpdateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsUpdateSamples.java new file mode 100644 index 0000000000000..8cb93d2648204 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsUpdateSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.VolumeGroup; +import java.util.HashMap; +import java.util.Map; + +/** Samples for VolumeGroups Update. */ +public final class VolumeGroupsUpdateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Update_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsUpdateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + VolumeGroup resource = + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key7736", "aa")) + .withProtocolType(StorageTargetType.ISCSI) + .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .apply(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeGroups_Update_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeGroupsUpdateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + VolumeGroup resource = + manager + .volumeGroups() + .getWithResponse("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE) + .getValue(); + resource.update().apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateSamples.java new file mode 100644 index 0000000000000..af70570c6778f --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateSamples.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.elasticsan.generated; + +import com.azure.resourcemanager.elasticsan.models.SourceCreationData; +import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes Create. */ +public final class VolumesCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .define("vt-h45-18D68-j3sg8") + .withRegion("aaaaaaaaaaa") + .withExistingVolumegroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5") + .withTags(mapOf("key9122", "aaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withCreationData( + new SourceCreationData() + .withCreateSource(VolumeCreateOption.NONE) + .withSourceUri("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .withSizeGiB(30L) + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .define("vt-h45-18D68-j3sg8") + .withRegion((String) null) + .withExistingVolumegroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5") + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteSamples.java new file mode 100644 index 0000000000000..4bca96e0ec7ad --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for Volumes Delete. */ +public final class VolumesDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .delete("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetSamples.java new file mode 100644 index 0000000000000..017fff2aa9a1d --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for Volumes Get. */ +public final class VolumesGetSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupSamples.java new file mode 100644 index 0000000000000..256e9fff6de3f --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +import com.azure.core.util.Context; + +/** Samples for Volumes ListByVolumeGroup. */ +public final class VolumesListByVolumeGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesListByVolumeGroupMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .listByVolumeGroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesListByVolumeGroupMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumes() + .listByVolumeGroup("rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesUpdateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesUpdateSamples.java new file mode 100644 index 0000000000000..6cfe3ccb005c2 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesUpdateSamples.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.elasticsan.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.models.Volume; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Volumes Update. */ +public final class VolumesUpdateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MinimumSet_Gen.json + */ + /** + * Sample code: Volumes_Update_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesUpdateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + Volume resource = + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MaximumSet_Gen.json + */ + /** + * Sample code: Volumes_Update_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumesUpdateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + Volume resource = + manager + .volumes() + .getWithResponse( + "rgelasticsan", "33zg-7s_4_7L2_65o", "9_67U25-1f2gR3-b6L-4T5", "vt-h45-18D68-j3sg8", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key4653", "aaaaaaaaa")).withSizeGiB(23L).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/elasticsan/ci.yml b/sdk/elasticsan/ci.yml new file mode 100644 index 0000000000000..815ea1fe4248f --- /dev/null +++ b/sdk/elasticsan/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.yml + - sdk/elasticsan/azure-resourcemanager-elasticsan/ + exclude: + - sdk/elasticsan/pom.xml + - sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.yml + - sdk/elasticsan/azure-resourcemanager-elasticsan/ + exclude: + - sdk/elasticsan/pom.xml + - sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: elasticsan + Artifacts: + - name: azure-resourcemanager-elasticsan + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerelasticsan diff --git a/sdk/elasticsan/pom.xml b/sdk/elasticsan/pom.xml new file mode 100644 index 0000000000000..726d064bcb970 --- /dev/null +++ b/sdk/elasticsan/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-elasticsan-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-elasticsan + + + +