From b7172962cdbd8bd32bd624e3b4d3db958d5b4ff2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 21 Sep 2023 06:46:11 +0000 Subject: [PATCH] CodeGen from PR 25687 in Azure/azure-rest-api-specs Merge 850ef10bdc46118c4efbcb93efd0ca76023f30e1 into 68d03f91ea7c30e1ab28fb9d35c13f81bc85b724 --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 414 +++++- .../azure-resourcemanager-elasticsan/pom.xml | 3 +- .../elasticsan/ElasticSanManager.java | 24 +- .../fluent/ElasticSanManagement.java | 7 + .../fluent/VolumeSnapshotsClient.java | 232 +++ .../elasticsan/fluent/VolumesClient.java | 26 +- .../fluent/models/ElasticSanInner.java | 26 + .../fluent/models/ElasticSanProperties.java | 30 + .../models/ElasticSanUpdateProperties.java | 30 + .../fluent/models/SnapshotInner.java | 118 ++ .../fluent/models/SnapshotProperties.java | 107 ++ .../fluent/models/VolumeGroupInner.java | 54 + .../fluent/models/VolumeGroupProperties.java | 30 + .../models/VolumeGroupUpdateProperties.java | 30 + .../elasticsan/fluent/models/VolumeInner.java | 50 + .../fluent/models/VolumeProperties.java | 46 + .../fluent/models/VolumeUpdateProperties.java | 30 + .../implementation/ElasticSanImpl.java | 25 + .../ElasticSanManagementBuilder.java | 2 +- .../ElasticSanManagementImpl.java | 16 +- .../implementation/SnapshotImpl.java | 129 ++ .../implementation/VolumeGroupImpl.java | 39 +- .../elasticsan/implementation/VolumeImpl.java | 29 + .../VolumeSnapshotsClientImpl.java | 1250 +++++++++++++++++ .../implementation/VolumeSnapshotsImpl.java | 225 +++ .../implementation/VolumesClientImpl.java | 201 ++- .../implementation/VolumesImpl.java | 46 +- .../elasticsan/models/Action.java | 52 +- .../elasticsan/models/ElasticSan.java | 67 +- .../elasticsan/models/ElasticSanUpdate.java | 25 + .../elasticsan/models/EncryptionIdentity.java | 53 + .../models/EncryptionProperties.java | 82 ++ .../elasticsan/models/EncryptionType.java | 4 + .../elasticsan/models/Identity.java | 131 ++ .../elasticsan/models/IdentityType.java | 50 + .../elasticsan/models/KeyVaultProperties.java | 151 ++ .../elasticsan/models/ManagedByInfo.java | 53 + .../models/PublicNetworkAccess.java | 50 + .../elasticsan/models/Snapshot.java | 151 ++ .../models/SnapshotCreationData.java | 61 + .../elasticsan/models/SnapshotList.java | 70 + .../elasticsan/models/SourceCreationData.java | 28 +- .../elasticsan/models/State.java | 60 - .../models/UserAssignedIdentity.java | 54 + .../elasticsan/models/VirtualNetworkRule.java | 15 - .../elasticsan/models/Volume.java | 48 +- .../elasticsan/models/VolumeCreateOption.java | 62 +- .../elasticsan/models/VolumeGroup.java | 83 +- .../elasticsan/models/VolumeGroupUpdate.java | 52 + .../elasticsan/models/VolumeSnapshots.java | 151 ++ .../elasticsan/models/VolumeUpdate.java | 23 + .../elasticsan/models/Volumes.java | 19 +- .../elasticsan/models/XMsDeleteSnapshots.java | 47 + .../elasticsan/models/XMsForceDelete.java | 47 + .../generated/ElasticSansCreateSamples.java | 15 +- .../generated/ElasticSansDeleteSamples.java | 4 +- .../ElasticSansGetByResourceGroupSamples.java | 4 +- ...ElasticSansListByResourceGroupSamples.java | 4 +- .../generated/ElasticSansListSamples.java | 4 +- .../generated/ElasticSansUpdateSamples.java | 14 +- .../generated/OperationsListSamples.java | 4 +- ...ivateEndpointConnectionsCreateSamples.java | 16 +- ...ivateEndpointConnectionsDeleteSamples.java | 4 +- .../PrivateEndpointConnectionsGetSamples.java | 4 +- ...PrivateEndpointConnectionsListSamples.java | 4 +- ...eLinkResourcesListByElasticSanSamples.java | 4 +- .../elasticsan/generated/SkusListSamples.java | 6 +- .../generated/VolumeGroupsCreateSamples.java | 38 +- .../generated/VolumeGroupsDeleteSamples.java | 4 +- .../generated/VolumeGroupsGetSamples.java | 4 +- .../VolumeGroupsListByElasticSanSamples.java | 4 +- .../generated/VolumeGroupsUpdateSamples.java | 49 +- .../VolumeSnapshotsCreateSamples.java | 52 + .../VolumeSnapshotsDeleteSamples.java | 48 + .../generated/VolumeSnapshotsGetSamples.java | 46 + ...lumeSnapshotsListByVolumeGroupSamples.java | 44 + .../generated/VolumesCreateSamples.java | 12 +- .../generated/VolumesDeleteSamples.java | 11 +- .../generated/VolumesGetSamples.java | 4 +- .../VolumesListByVolumeGroupSamples.java | 4 +- .../generated/VolumesUpdateSamples.java | 4 +- .../generated/ElasticSanInnerTests.java | 64 - .../generated/ElasticSanListTests.java | 70 - .../generated/ElasticSanPropertiesTests.java | 45 - .../ElasticSanUpdatePropertiesTests.java | 32 - .../generated/ElasticSanUpdateTests.java | 58 - .../generated/ElasticSansCreateMockTests.java | 100 -- .../generated/ElasticSansDeleteMockTests.java | 61 - ...tByResourceGroupWithResponseMockTests.java | 78 - ...asticSansListByResourceGroupMockTests.java | 76 - .../generated/ElasticSansListMockTests.java | 75 - .../generated/IscsiTargetInfoTests.java | 29 - .../generated/NetworkRuleSetTests.java | 40 - .../generated/OperationDisplayTests.java | 25 - .../generated/OperationInnerTests.java | 26 - .../generated/OperationListResultTests.java | 25 - .../generated/OperationsListMockTests.java | 64 - .../PrivateEndpointConnectionInnerTests.java | 50 - ...vateEndpointConnectionListResultTests.java | 59 - ...vateEndpointConnectionPropertiesTests.java | 50 - ...ateEndpointConnectionsCreateMockTests.java | 87 -- ...ateEndpointConnectionsDeleteMockTests.java | 63 - ...ntConnectionsGetWithResponseMockTests.java | 76 - ...ivateEndpointConnectionsListMockTests.java | 77 - .../generated/PrivateEndpointTests.java | 21 - ...ivateLinkResourceListResultInnerTests.java | 40 - .../PrivateLinkResourcePropertiesTests.java | 30 - .../generated/PrivateLinkResourceTests.java | 30 - ...ListByElasticSanWithResponseMockTests.java | 70 - ...rivateLinkServiceConnectionStateTests.java | 36 - .../generated/SkuCapabilityTests.java | 22 - .../generated/SkuInformationInnerTests.java | 32 - .../generated/SkuInformationListTests.java | 25 - .../generated/SkuLocationInfoTests.java | 24 - .../elasticsan/generated/SkuTests.java | 28 - .../generated/SkusListMockTests.java | 70 - .../generated/SourceCreationDataTests.java | 31 - .../generated/VirtualNetworkRuleTests.java | 31 - .../generated/VolumeGroupInnerTests.java | 56 - .../generated/VolumeGroupListTests.java | 63 - .../generated/VolumeGroupPropertiesTests.java | 58 - .../VolumeGroupUpdatePropertiesTests.java | 60 - .../generated/VolumeGroupUpdateTests.java | 60 - .../VolumeGroupsCreateMockTests.java | 92 -- .../VolumeGroupsDeleteMockTests.java | 61 - .../VolumeGroupsGetWithResponseMockTests.java | 76 - ...VolumeGroupsListByElasticSanMockTests.java | 79 -- .../generated/VolumeInnerTests.java | 38 - .../elasticsan/generated/VolumeListTests.java | 64 - .../generated/VolumePropertiesTests.java | 37 - .../VolumeUpdatePropertiesTests.java | 25 - .../generated/VolumeUpdateTests.java | 25 - .../generated/VolumesCreateMockTests.java | 79 -- .../generated/VolumesDeleteMockTests.java | 61 - .../VolumesGetWithResponseMockTests.java | 73 - .../VolumesListByVolumeGroupMockTests.java | 73 - 138 files changed, 5015 insertions(+), 3212 deletions(-) create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeSnapshotsClient.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotInner.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SnapshotImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeSnapshotsClientImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeSnapshotsImpl.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionIdentity.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Identity.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IdentityType.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/KeyVaultProperties.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ManagedByInfo.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PublicNetworkAccess.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Snapshot.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotCreationData.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotList.java delete 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/UserAssignedIdentity.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeSnapshots.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsDeleteSnapshots.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsForceDelete.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsCreateSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsDeleteSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsGetSamples.java create mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsListByVolumeGroupSamples.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanListTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanPropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdatePropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdateTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/IscsiTargetInfoTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/NetworkRuleSetTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationDisplayTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationListResultTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationsListMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionListResultTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionPropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceListResultInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcePropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanWithResponseMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkServiceConnectionStateTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuCapabilityTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationListTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuLocationInfoTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkusListMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SourceCreationDataTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VirtualNetworkRuleTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupListTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupPropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdatePropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdateTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetWithResponseMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeInnerTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeListTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumePropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdatePropertiesTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdateTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetWithResponseMockTests.java delete mode 100644 sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupMockTests.java diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md index 8da1aa9d502a..4298c32bd17f 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-09-21) + +- Azure Resource Manager ElasticSan client library for Java. This package contains Microsoft Azure SDK for ElasticSan Management SDK. Package tag package-2023-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md index 20e090431410..d789017e37fd 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ElasticSan client library for Java. -This package contains Microsoft Azure SDK for ElasticSan Management SDK. Package tag package-preview-2022-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ElasticSan Management SDK. Package tag package-2023-01. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-elasticsan - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md index bec500450d78..35c8f64cabd1 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md @@ -37,6 +37,13 @@ - [ListByElasticSan](#volumegroups_listbyelasticsan) - [Update](#volumegroups_update) +## VolumeSnapshots + +- [Create](#volumesnapshots_create) +- [Delete](#volumesnapshots_delete) +- [Get](#volumesnapshots_get) +- [ListByVolumeGroup](#volumesnapshots_listbyvolumegroup) + ## Volumes - [Create](#volumes_create) @@ -47,6 +54,7 @@ ### ElasticSans_Create ```java +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; import com.azure.resourcemanager.elasticsan.models.Sku; import com.azure.resourcemanager.elasticsan.models.SkuName; import com.azure.resourcemanager.elasticsan.models.SkuTier; @@ -57,7 +65,7 @@ import java.util.Map; /** Samples for ElasticSans Create. */ public final class ElasticSansCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MaximumSet_Gen. @@ -68,18 +76,19 @@ public final class ElasticSansCreateSamples { manager .elasticSans() .define("elasticsanname") - .withRegion("South Central US") + .withRegion("France Central") .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) .withBaseSizeTiB(5L) .withExtendedCapacitySizeTiB(25L) .withTags(mapOf("key9316", "fakeTokenPlaceholder")) .withAvailabilityZones(Arrays.asList("1")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MinimumSet_Gen. @@ -90,14 +99,15 @@ public final class ElasticSansCreateSamples { manager .elasticSans() .define("elasticsanname") - .withRegion("South Central US") + .withRegion("France Central") .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) - .withBaseSizeTiB(5L) - .withExtendedCapacitySizeTiB(25L) + .withBaseSizeTiB(15L) + .withExtendedCapacitySizeTiB(27L) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -117,7 +127,7 @@ public final class ElasticSansCreateSamples { /** Samples for ElasticSans Delete. */ public final class ElasticSansDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MinimumSet_Gen. @@ -129,7 +139,7 @@ public final class ElasticSansDeleteSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MaximumSet_Gen. @@ -148,7 +158,7 @@ public final class ElasticSansDeleteSamples { /** Samples for ElasticSans GetByResourceGroup. */ public final class ElasticSansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MinimumSet_Gen. @@ -162,7 +172,7 @@ public final class ElasticSansGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MaximumSet_Gen. @@ -183,7 +193,7 @@ public final class ElasticSansGetByResourceGroupSamples { /** Samples for ElasticSans List. */ public final class ElasticSansListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen. @@ -196,7 +206,7 @@ public final class ElasticSansListSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MinimumSet_Gen. @@ -216,7 +226,7 @@ public final class ElasticSansListSamples { /** Samples for ElasticSans ListByResourceGroup. */ public final class ElasticSansListByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MinimumSet_Gen. @@ -229,7 +239,7 @@ public final class ElasticSansListByResourceGroupSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen. @@ -247,13 +257,14 @@ public final class ElasticSansListByResourceGroupSamples { ```java import com.azure.resourcemanager.elasticsan.models.ElasticSan; +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; 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/2022-12-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MinimumSet_Gen. @@ -270,7 +281,7 @@ public final class ElasticSansUpdateSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MaximumSet_Gen. @@ -283,9 +294,16 @@ public final class ElasticSansUpdateSamples { .elasticSans() .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("key4212", "fakeTokenPlaceholder")).apply(); + resource + .update() + .withTags(mapOf("key1931", "fakeTokenPlaceholder")) + .withBaseSizeTiB(13L) + .withExtendedCapacitySizeTiB(29L) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -305,7 +323,7 @@ public final class ElasticSansUpdateSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -317,7 +335,7 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. @@ -341,7 +359,7 @@ import java.util.Arrays; /** Samples for PrivateEndpointConnections Create. */ public final class PrivateEndpointConnectionsCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Create_MaximumSet_Gen. @@ -357,15 +375,15 @@ public final class PrivateEndpointConnectionsCreateSamples { .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState() .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("Auto-Approved") - .withActionsRequired("None")) + .withDescription("dxl") + .withActionsRequired("jhjdpwvyzipggtn")) .withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("sytxzqlcoapcaywthgwvwcw")) + .withGroupIds(Arrays.asList("jdwrzpemdjrpiwzvy")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Create_MinimumSet_Gen. @@ -378,11 +396,7 @@ public final class PrivateEndpointConnectionsCreateSamples { .privateEndpointConnections() .define("privateendpointconnectionname") .withExistingElasticSan("resourcegroupname", "elasticsanname") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("Auto-Approved") - .withActionsRequired("None")) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState()) .create(); } } @@ -394,7 +408,7 @@ public final class PrivateEndpointConnectionsCreateSamples { /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Delete_MaximumSet_Gen. @@ -413,7 +427,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Delete_MinimumSet_Gen. @@ -439,7 +453,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Get_MinimumSet_Gen. @@ -458,7 +472,7 @@ public final class PrivateEndpointConnectionsGetSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Get_MaximumSet_Gen. @@ -484,7 +498,7 @@ public final class PrivateEndpointConnectionsGetSamples { /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_List_MinimumSet_Gen. @@ -499,7 +513,7 @@ public final class PrivateEndpointConnectionsListSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_List_MaximumSet_Gen. @@ -521,7 +535,7 @@ public final class PrivateEndpointConnectionsListSamples { /** Samples for PrivateLinkResources ListByElasticSan. */ public final class PrivateLinkResourcesListByElasticSanSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json */ /** * Sample code: PrivateLinkResources_ListByElasticSan_MinimumSet_Gen. @@ -536,7 +550,7 @@ public final class PrivateLinkResourcesListByElasticSanSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json */ /** * Sample code: PrivateLinkResources_ListByElasticSan_MaximumSet_Gen. @@ -558,7 +572,7 @@ public final class PrivateLinkResourcesListByElasticSanSamples { /** Samples for Skus List. */ public final class SkusListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MinimumSet_Gen.json */ /** * Sample code: Skus_List_MinimumSet_Gen. @@ -570,7 +584,7 @@ public final class SkusListSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MaximumSet_Gen.json */ /** * Sample code: Skus_List_MaximumSet_Gen. @@ -578,7 +592,7 @@ public final class SkusListSamples { * @param manager Entry point to ElasticSanManager. */ public static void skusListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.skus().list("dtycml", com.azure.core.util.Context.NONE); + manager.skus().list("obwwdrkq", com.azure.core.util.Context.NONE); } } ``` @@ -587,16 +601,24 @@ public final class SkusListSamples { ```java import com.azure.resourcemanager.elasticsan.models.Action; +import com.azure.resourcemanager.elasticsan.models.EncryptionIdentity; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.Identity; +import com.azure.resourcemanager.elasticsan.models.IdentityType; +import com.azure.resourcemanager.elasticsan.models.KeyVaultProperties; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.UserAssignedIdentity; 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/2022-12-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MinimumSet_Gen. @@ -612,7 +634,7 @@ public final class VolumeGroupsCreateSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MaximumSet_Gen. @@ -624,8 +646,20 @@ public final class VolumeGroupsCreateSamples { .volumeGroups() .define("volumegroupname") .withExistingElasticSan("resourcegroupname", "elasticsanname") + .withIdentity( + new Identity() + .withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("key7482", new UserAssignedIdentity()))) .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_CUSTOMER_MANAGED_KEY) + .withEncryptionProperties( + new EncryptionProperties() + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity("im"))) .withNetworkAcls( new NetworkRuleSet() .withVirtualNetworkRules( @@ -637,6 +671,18 @@ public final class VolumeGroupsCreateSamples { .withAction(Action.ALLOW)))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -646,7 +692,7 @@ public final class VolumeGroupsCreateSamples { /** Samples for VolumeGroups Delete. */ public final class VolumeGroupsDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MinimumSet_Gen. @@ -660,7 +706,7 @@ public final class VolumeGroupsDeleteSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MaximumSet_Gen. @@ -681,7 +727,7 @@ public final class VolumeGroupsDeleteSamples { /** Samples for VolumeGroups Get. */ public final class VolumeGroupsGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MinimumSet_Gen. @@ -696,7 +742,7 @@ public final class VolumeGroupsGetSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MaximumSet_Gen. @@ -718,7 +764,7 @@ public final class VolumeGroupsGetSamples { /** Samples for VolumeGroups ListByElasticSan. */ public final class VolumeGroupsListByElasticSanSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen. @@ -733,7 +779,7 @@ public final class VolumeGroupsListByElasticSanSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen. @@ -752,14 +798,26 @@ public final class VolumeGroupsListByElasticSanSamples { ### VolumeGroups_Update ```java +import com.azure.resourcemanager.elasticsan.models.Action; +import com.azure.resourcemanager.elasticsan.models.EncryptionIdentity; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.Identity; +import com.azure.resourcemanager.elasticsan.models.IdentityType; +import com.azure.resourcemanager.elasticsan.models.KeyVaultProperties; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.UserAssignedIdentity; +import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; import com.azure.resourcemanager.elasticsan.models.VolumeGroup; +import java.util.Arrays; +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/2022-12-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MaximumSet_Gen. @@ -775,13 +833,34 @@ public final class VolumeGroupsUpdateSamples { .getValue(); resource .update() + .withIdentity( + new Identity() + .withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("key7482", new UserAssignedIdentity()))) .withProtocolType(StorageTargetType.ISCSI) .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .withEncryptionProperties( + new EncryptionProperties() + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity("im"))) + .withNetworkAcls( + new NetworkRuleSet() + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule() + .withVirtualNetworkResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}") + .withAction(Action.ALLOW)))) .apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MinimumSet_Gen. @@ -797,19 +876,218 @@ public final class VolumeGroupsUpdateSamples { .getValue(); resource.update().apply(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### VolumeSnapshots_Create + +```java +import com.azure.resourcemanager.elasticsan.models.SnapshotCreationData; + +/** Samples for VolumeSnapshots Create. */ +public final class VolumeSnapshotsCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsCreateMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .define("snapshotname") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withCreationData( + new SnapshotCreationData() + .withSourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}")) + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsCreateMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .define("snapshotname") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withCreationData( + new SnapshotCreationData() + .withSourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}")) + .create(); + } +} +``` + +### VolumeSnapshots_Delete + +```java +/** Samples for VolumeSnapshots Delete. */ +public final class VolumeSnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsDeleteMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsDeleteMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } +} +``` + +### VolumeSnapshots_Get + +```java +/** Samples for VolumeSnapshots Get. */ +public final class VolumeSnapshotsGetSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } +} +``` + +### VolumeSnapshots_ListByVolumeGroup + +```java +/** Samples for VolumeSnapshots ListByVolumeGroup. */ +public final class VolumeSnapshotsListByVolumeGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsListByVolumeGroupMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .listByVolumeGroup( + "resourcegroupname", "elasticsanname", "volumegroupname", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsListByVolumeGroupMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumeName eq ", + com.azure.core.util.Context.NONE); + } } ``` ### Volumes_Create ```java +import com.azure.resourcemanager.elasticsan.models.ManagedByInfo; import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; /** Samples for Volumes Create. */ public final class VolumesCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MaximumSet_Gen.json */ /** * Sample code: Volumes_Create_MaximumSet_Gen. @@ -821,14 +1099,15 @@ public final class VolumesCreateSamples { .volumes() .define("volumename") .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") - .withSizeGiB(23L) + .withSizeGiB(9L) .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri(" ARM Id of resource")) + new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceId("ARM Id of Resource")) + .withManagedBy(new ManagedByInfo().withResourceId("mtkeip")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MinimumSet_Gen.json */ /** * Sample code: Volumes_Create_MinimumSet_Gen. @@ -840,7 +1119,7 @@ public final class VolumesCreateSamples { .volumes() .define("volumename") .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") - .withSizeGiB(23L) + .withSizeGiB(9L) .create(); } } @@ -849,10 +1128,13 @@ public final class VolumesCreateSamples { ### Volumes_Delete ```java +import com.azure.resourcemanager.elasticsan.models.XMsDeleteSnapshots; +import com.azure.resourcemanager.elasticsan.models.XMsForceDelete; + /** Samples for Volumes Delete. */ public final class VolumesDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MinimumSet_Gen.json */ /** * Sample code: Volumes_Delete_MinimumSet_Gen. @@ -867,11 +1149,13 @@ public final class VolumesDeleteSamples { "elasticsanname", "volumegroupname", "volumename", + null, + null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MaximumSet_Gen.json */ /** * Sample code: Volumes_Delete_MaximumSet_Gen. @@ -886,6 +1170,8 @@ public final class VolumesDeleteSamples { "elasticsanname", "volumegroupname", "volumename", + XMsDeleteSnapshots.TRUE, + XMsForceDelete.TRUE, com.azure.core.util.Context.NONE); } } @@ -897,7 +1183,7 @@ public final class VolumesDeleteSamples { /** Samples for Volumes Get. */ public final class VolumesGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MaximumSet_Gen.json */ /** * Sample code: Volumes_Get_MaximumSet_Gen. @@ -916,7 +1202,7 @@ public final class VolumesGetSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MinimumSet_Gen.json */ /** * Sample code: Volumes_Get_MinimumSet_Gen. @@ -942,7 +1228,7 @@ public final class VolumesGetSamples { /** Samples for Volumes ListByVolumeGroup. */ public final class VolumesListByVolumeGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen. @@ -958,7 +1244,7 @@ public final class VolumesListByVolumeGroupSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen. @@ -983,7 +1269,7 @@ import com.azure.resourcemanager.elasticsan.models.Volume; /** Samples for Volumes Update. */ public final class VolumesUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MinimumSet_Gen.json */ /** * Sample code: Volumes_Update_MinimumSet_Gen. @@ -1005,7 +1291,7 @@ public final class VolumesUpdateSamples { } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MaximumSet_Gen.json */ /** * Sample code: Volumes_Update_MaximumSet_Gen. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml index 4855c2994691..0032e5e77338 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml @@ -18,7 +18,7 @@ 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-preview-2022-12. + 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-2023-01. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true 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 index cf2135865097..290b77c39a5f 100644 --- 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 @@ -31,6 +31,7 @@ import com.azure.resourcemanager.elasticsan.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.elasticsan.implementation.SkusImpl; import com.azure.resourcemanager.elasticsan.implementation.VolumeGroupsImpl; +import com.azure.resourcemanager.elasticsan.implementation.VolumeSnapshotsImpl; import com.azure.resourcemanager.elasticsan.implementation.VolumesImpl; import com.azure.resourcemanager.elasticsan.models.ElasticSans; import com.azure.resourcemanager.elasticsan.models.Operations; @@ -38,6 +39,7 @@ import com.azure.resourcemanager.elasticsan.models.PrivateLinkResources; import com.azure.resourcemanager.elasticsan.models.Skus; import com.azure.resourcemanager.elasticsan.models.VolumeGroups; +import com.azure.resourcemanager.elasticsan.models.VolumeSnapshots; import com.azure.resourcemanager.elasticsan.models.Volumes; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -62,6 +64,8 @@ public final class ElasticSanManager { private PrivateLinkResources privateLinkResources; + private VolumeSnapshots volumeSnapshots; + private final ElasticSanManagement clientObject; private ElasticSanManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -227,7 +231,7 @@ public ElasticSanManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.elasticsan") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -370,8 +374,22 @@ public PrivateLinkResources privateLinkResources() { } /** - * @return Wrapped service client ElasticSanManagement providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets the resource collection API of VolumeSnapshots. It manages Snapshot. + * + * @return Resource collection API of VolumeSnapshots. + */ + public VolumeSnapshots volumeSnapshots() { + if (this.volumeSnapshots == null) { + this.volumeSnapshots = new VolumeSnapshotsImpl(clientObject.getVolumeSnapshots(), this); + } + return volumeSnapshots; + } + + /** + * Gets wrapped service client ElasticSanManagement providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client ElasticSanManagement. */ 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 index b8010b7a9503..1ee56bf20a0a 100644 --- 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 @@ -92,4 +92,11 @@ public interface ElasticSanManagement { * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the VolumeSnapshotsClient object to access its operations. + * + * @return the VolumeSnapshotsClient object. + */ + VolumeSnapshotsClient getVolumeSnapshots(); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeSnapshotsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeSnapshotsClient.java new file mode 100644 index 000000000000..2e3f09198321 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeSnapshotsClient.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.SnapshotInner; + +/** An instance of this class provides access to all the operations defined in VolumeSnapshotsClient. */ +public interface VolumeSnapshotsClient { + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 Snapshots as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName); + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter, Context context); + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters); + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters, + Context context); + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters); + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters, + Context context); + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName); + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName, Context context); + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName); + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context); + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context); + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SnapshotInner get(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName); +} 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 index db88375ad0d0..dc4ab672a994 100644 --- 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 @@ -13,6 +13,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; +import com.azure.resourcemanager.elasticsan.models.XMsDeleteSnapshots; +import com.azure.resourcemanager.elasticsan.models.XMsForceDelete; /** An instance of this class provides access to all the operations defined in VolumesClient. */ public interface VolumesClient { @@ -215,6 +217,10 @@ SyncPoller, Void> beginDelete( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -223,7 +229,13 @@ SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context); + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context); /** * Delete an Volume. @@ -246,6 +258,10 @@ SyncPoller, Void> beginDelete( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -253,7 +269,13 @@ SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) void delete( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context); + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context); /** * Get an Volume. 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 index 3a5f17724b16..b7913ee7beda 100644 --- 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 @@ -9,6 +9,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; import com.azure.resourcemanager.elasticsan.models.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -220,6 +221,31 @@ public List privateEndpointConnections() { return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to ElasticSan. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to ElasticSan. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ElasticSanInner object itself. + */ + public ElasticSanInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + /** * Validates the instance. * 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 index b1eb94cf20c4..246e3f04c027 100644 --- 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 @@ -7,6 +7,7 @@ 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.PublicNetworkAccess; import com.azure.resourcemanager.elasticsan.models.Sku; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -80,6 +81,13 @@ public final class ElasticSanProperties { @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; + /* + * Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or + * 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + /** Creates an instance of ElasticSanProperties class. */ public ElasticSanProperties() { } @@ -227,6 +235,28 @@ public List privateEndpointConnections() { return this.privateEndpointConnections; } + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to ElasticSan. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to ElasticSan. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ElasticSanProperties object itself. + */ + public ElasticSanProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Validates the instance. * 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 index 83ef4c13fa57..6b488be7de10 100644 --- 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.elasticsan.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; import com.fasterxml.jackson.annotation.JsonProperty; /** Elastic San update properties. */ @@ -22,6 +23,13 @@ public final class ElasticSanUpdateProperties { @JsonProperty(value = "extendedCapacitySizeTiB") private Long extendedCapacitySizeTiB; + /* + * Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be + * 'Enabled' or 'Disabled'. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + /** Creates an instance of ElasticSanUpdateProperties class. */ public ElasticSanUpdateProperties() { } @@ -66,6 +74,28 @@ public ElasticSanUpdateProperties withExtendedCapacitySizeTiB(Long extendedCapac return this; } + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to ElasticSan Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to ElasticSan Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ElasticSanUpdateProperties object itself. + */ + public ElasticSanUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + /** * Validates the instance. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotInner.java new file mode 100644 index 000000000000..2812e5427839 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotInner.java @@ -0,0 +1,118 @@ +// 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.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.SnapshotCreationData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for Volume Snapshot request. */ +@Fluent +public final class SnapshotInner extends ProxyResource { + /* + * Properties of Volume Snapshot. + */ + @JsonProperty(value = "properties", required = true) + private SnapshotProperties innerProperties = new SnapshotProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SnapshotInner class. */ + public SnapshotInner() { + } + + /** + * Get the innerProperties property: Properties of Volume Snapshot. + * + * @return the innerProperties value. + */ + private SnapshotProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the creationData property: Data used when creating a volume snapshot. + * + * @return the creationData value. + */ + public SnapshotCreationData creationData() { + return this.innerProperties() == null ? null : this.innerProperties().creationData(); + } + + /** + * Set the creationData property: Data used when creating a volume snapshot. + * + * @param creationData the creationData value to set. + * @return the SnapshotInner object itself. + */ + public SnapshotInner withCreationData(SnapshotCreationData creationData) { + if (this.innerProperties() == null) { + this.innerProperties = new SnapshotProperties(); + } + this.innerProperties().withCreationData(creationData); + 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 sourceVolumeSizeGiB property: Size of Source Volume. + * + * @return the sourceVolumeSizeGiB value. + */ + public Long sourceVolumeSizeGiB() { + return this.innerProperties() == null ? null : this.innerProperties().sourceVolumeSizeGiB(); + } + + /** + * Get the volumeName property: Source Volume Name of a snapshot. + * + * @return the volumeName value. + */ + public String volumeName() { + return this.innerProperties() == null ? null : this.innerProperties().volumeName(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model SnapshotInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotInner.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotProperties.java new file mode 100644 index 000000000000..e9330ddcf224 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/SnapshotProperties.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.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.SnapshotCreationData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties for Snapshot. */ +@Fluent +public final class SnapshotProperties { + /* + * Data used when creating a volume snapshot. + */ + @JsonProperty(value = "creationData", required = true) + private SnapshotCreationData creationData; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Size of Source Volume + */ + @JsonProperty(value = "sourceVolumeSizeGiB", access = JsonProperty.Access.WRITE_ONLY) + private Long sourceVolumeSizeGiB; + + /* + * Source Volume Name of a snapshot + */ + @JsonProperty(value = "volumeName", access = JsonProperty.Access.WRITE_ONLY) + private String volumeName; + + /** Creates an instance of SnapshotProperties class. */ + public SnapshotProperties() { + } + + /** + * Get the creationData property: Data used when creating a volume snapshot. + * + * @return the creationData value. + */ + public SnapshotCreationData creationData() { + return this.creationData; + } + + /** + * Set the creationData property: Data used when creating a volume snapshot. + * + * @param creationData the creationData value to set. + * @return the SnapshotProperties object itself. + */ + public SnapshotProperties withCreationData(SnapshotCreationData creationData) { + this.creationData = creationData; + 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 sourceVolumeSizeGiB property: Size of Source Volume. + * + * @return the sourceVolumeSizeGiB value. + */ + public Long sourceVolumeSizeGiB() { + return this.sourceVolumeSizeGiB; + } + + /** + * Get the volumeName property: Source Volume Name of a snapshot. + * + * @return the volumeName value. + */ + public String volumeName() { + return this.volumeName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (creationData() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property creationData in model SnapshotProperties")); + } else { + creationData().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotProperties.class); +} 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 index 7e96c62d9916..69d6085607c0 100644 --- 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.Identity; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; @@ -17,6 +19,12 @@ /** Response for Volume Group request. */ @Fluent public final class VolumeGroupInner extends ProxyResource { + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + /* * Properties of VolumeGroup. */ @@ -33,6 +41,26 @@ public final class VolumeGroupInner extends ProxyResource { public VolumeGroupInner() { } + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the VolumeGroupInner object itself. + */ + public VolumeGroupInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + /** * Get the innerProperties property: Properties of VolumeGroup. * @@ -106,6 +134,29 @@ public VolumeGroupInner withEncryption(EncryptionType encryption) { return this; } + /** + * Get the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the VolumeGroupInner object itself. + */ + public VolumeGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + /** * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. * @@ -144,6 +195,9 @@ public List privateEndpointConnections() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/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 index 36be8777650c..46829901948f 100644 --- 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.elasticsan.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; @@ -33,6 +34,12 @@ public final class VolumeGroupProperties { @JsonProperty(value = "encryption") private EncryptionType encryption; + /* + * Encryption Properties describing Key Vault and Identity information + */ + @JsonProperty(value = "encryptionProperties") + private EncryptionProperties encryptionProperties; + /* * A collection of rules governing the accessibility from specific network locations. */ @@ -98,6 +105,26 @@ public VolumeGroupProperties withEncryption(EncryptionType encryption) { return this; } + /** + * Get the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the VolumeGroupProperties object itself. + */ + public VolumeGroupProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + /** * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. * @@ -133,6 +160,9 @@ public List privateEndpointConnections() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (encryptionProperties() != null) { + encryptionProperties().validate(); + } if (networkAcls() != null) { networkAcls().validate(); } 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 index 8575a064dbac..8a40826e953f 100644 --- 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.elasticsan.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; @@ -25,6 +26,12 @@ public final class VolumeGroupUpdateProperties { @JsonProperty(value = "encryption") private EncryptionType encryption; + /* + * Encryption Properties describing Key Vault and Identity information + */ + @JsonProperty(value = "encryptionProperties") + private EncryptionProperties encryptionProperties; + /* * A collection of rules governing the accessibility from specific network locations. */ @@ -75,6 +82,26 @@ public VolumeGroupUpdateProperties withEncryption(EncryptionType encryption) { return this; } + /** + * Get the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the VolumeGroupUpdateProperties object itself. + */ + public VolumeGroupUpdateProperties withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + /** * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. * @@ -101,6 +128,9 @@ public VolumeGroupUpdateProperties withNetworkAcls(NetworkRuleSet networkAcls) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (encryptionProperties() != null) { + encryptionProperties().validate(); + } if (networkAcls() != null) { networkAcls().validate(); } 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 index 1380ecb3c1f5..1d34175fef67 100644 --- 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 @@ -6,8 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo; +import com.azure.resourcemanager.elasticsan.models.ManagedByInfo; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,6 +23,12 @@ public final class VolumeInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private VolumeProperties innerProperties = new VolumeProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** Creates an instance of VolumeInner class. */ public VolumeInner() { } @@ -33,6 +42,15 @@ private VolumeProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the volumeId property: Unique Id of the volume in GUID format. * @@ -97,6 +115,38 @@ public IscsiTargetInfo storageTarget() { return this.innerProperties() == null ? null : this.innerProperties().storageTarget(); } + /** + * Get the managedBy property: Parent resource information. + * + * @return the managedBy value. + */ + public ManagedByInfo managedBy() { + return this.innerProperties() == null ? null : this.innerProperties().managedBy(); + } + + /** + * Set the managedBy property: Parent resource information. + * + * @param managedBy the managedBy value to set. + * @return the VolumeInner object itself. + */ + public VolumeInner withManagedBy(ManagedByInfo managedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeProperties(); + } + this.innerProperties().withManagedBy(managedBy); + 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(); + } + /** * Validates the instance. * 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 index 0dbabf2eebe0..19175fae6b65 100644 --- 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 @@ -6,6 +6,8 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo; +import com.azure.resourcemanager.elasticsan.models.ManagedByInfo; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,18 @@ public final class VolumeProperties { @JsonProperty(value = "storageTarget", access = JsonProperty.Access.WRITE_ONLY) private IscsiTargetInfo storageTarget; + /* + * Parent resource information. + */ + @JsonProperty(value = "managedBy") + private ManagedByInfo managedBy; + + /* + * State of the operation on the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + /** Creates an instance of VolumeProperties class. */ public VolumeProperties() { } @@ -98,6 +112,35 @@ public IscsiTargetInfo storageTarget() { return this.storageTarget; } + /** + * Get the managedBy property: Parent resource information. + * + * @return the managedBy value. + */ + public ManagedByInfo managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: Parent resource information. + * + * @param managedBy the managedBy value to set. + * @return the VolumeProperties object itself. + */ + public VolumeProperties withManagedBy(ManagedByInfo managedBy) { + this.managedBy = managedBy; + return this; + } + + /** + * Get the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + /** * Validates the instance. * @@ -110,5 +153,8 @@ public void validate() { if (storageTarget() != null) { storageTarget().validate(); } + if (managedBy() != null) { + managedBy().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 index cff4fd488fc8..4f5b6f08eeb8 100644 --- 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.elasticsan.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.ManagedByInfo; import com.fasterxml.jackson.annotation.JsonProperty; /** Volume response properties. */ @@ -16,6 +17,12 @@ public final class VolumeUpdateProperties { @JsonProperty(value = "sizeGiB") private Long sizeGiB; + /* + * Parent resource information. + */ + @JsonProperty(value = "managedBy") + private ManagedByInfo managedBy; + /** Creates an instance of VolumeUpdateProperties class. */ public VolumeUpdateProperties() { } @@ -40,11 +47,34 @@ public VolumeUpdateProperties withSizeGiB(Long sizeGiB) { return this; } + /** + * Get the managedBy property: Parent resource information. + * + * @return the managedBy value. + */ + public ManagedByInfo managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: Parent resource information. + * + * @param managedBy the managedBy value to set. + * @return the VolumeUpdateProperties object itself. + */ + public VolumeUpdateProperties withManagedBy(ManagedByInfo managedBy) { + this.managedBy = managedBy; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (managedBy() != null) { + managedBy().validate(); + } } } 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 index c90cbea8350e..5bee4916d698 100644 --- 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 @@ -13,6 +13,7 @@ import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate; import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; import com.azure.resourcemanager.elasticsan.models.Sku; import java.util.Collections; import java.util.List; @@ -112,6 +113,10 @@ public List privateEndpointConnections() { } } + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -257,6 +262,26 @@ public ElasticSanImpl withAvailabilityZones(List availabilityZones) { return this; } + public ElasticSanImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public ElasticSanImpl withBaseSizeTiB(Long baseSizeTiB) { + this.updateParameters.withBaseSizeTiB(baseSizeTiB); + return this; + } + + public ElasticSanImpl withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB) { + this.updateParameters.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 index a4ddaff3e45d..cf756b3bd7c5 100644 --- 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 @@ -137,7 +137,7 @@ public ElasticSanManagementImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); 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 index 971d737d3a63..c8b56056fb4d 100644 --- 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 @@ -29,6 +29,7 @@ import com.azure.resourcemanager.elasticsan.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.elasticsan.fluent.SkusClient; import com.azure.resourcemanager.elasticsan.fluent.VolumeGroupsClient; +import com.azure.resourcemanager.elasticsan.fluent.VolumeSnapshotsClient; import com.azure.resourcemanager.elasticsan.fluent.VolumesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -198,6 +199,18 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** The VolumeSnapshotsClient object to access its operations. */ + private final VolumeSnapshotsClient volumeSnapshots; + + /** + * Gets the VolumeSnapshotsClient object to access its operations. + * + * @return the VolumeSnapshotsClient object. + */ + public VolumeSnapshotsClient getVolumeSnapshots() { + return this.volumeSnapshots; + } + /** * Initializes an instance of ElasticSanManagement client. * @@ -220,7 +233,7 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-12-01-preview"; + this.apiVersion = "2023-01-01"; this.operations = new OperationsClientImpl(this); this.skus = new SkusClientImpl(this); this.elasticSans = new ElasticSansClientImpl(this); @@ -228,6 +241,7 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { this.volumes = new VolumesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.volumeSnapshots = new VolumeSnapshotsClientImpl(this); } /** diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SnapshotImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SnapshotImpl.java new file mode 100644 index 000000000000..1005d93b2d68 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SnapshotImpl.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.SnapshotInner; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.azure.resourcemanager.elasticsan.models.Snapshot; +import com.azure.resourcemanager.elasticsan.models.SnapshotCreationData; + +public final class SnapshotImpl implements Snapshot, Snapshot.Definition { + private SnapshotInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + SnapshotImpl(SnapshotInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SnapshotCreationData creationData() { + return this.innerModel().creationData(); + } + + public ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + + public Long sourceVolumeSizeGiB() { + return this.innerModel().sourceVolumeSizeGiB(); + } + + public String volumeName() { + return this.innerModel().volumeName(); + } + + public SnapshotInner 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 snapshotName; + + public SnapshotImpl withExistingVolumegroup( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + this.resourceGroupName = resourceGroupName; + this.elasticSanName = elasticSanName; + this.volumeGroupName = volumeGroupName; + return this; + } + + public Snapshot create() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeSnapshots() + .create( + resourceGroupName, elasticSanName, volumeGroupName, snapshotName, this.innerModel(), Context.NONE); + return this; + } + + public Snapshot create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeSnapshots() + .create(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, this.innerModel(), context); + return this; + } + + SnapshotImpl(String name, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = new SnapshotInner(); + this.serviceManager = serviceManager; + this.snapshotName = name; + } + + public Snapshot refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeSnapshots() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, Context.NONE) + .getValue(); + return this; + } + + public Snapshot refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getVolumeSnapshots() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context) + .getValue(); + return this; + } + + public SnapshotImpl withCreationData(SnapshotCreationData creationData) { + this.innerModel().withCreationData(creationData); + return this; + } +} 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 index 6071e1e8a19a..bfde6613d1cd 100644 --- 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 @@ -8,7 +8,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.Identity; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; @@ -36,6 +38,10 @@ public String type() { return this.innerModel().type(); } + public Identity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -52,6 +58,10 @@ public EncryptionType encryption() { return this.innerModel().encryption(); } + public EncryptionProperties encryptionProperties() { + return this.innerModel().encryptionProperties(); + } + public NetworkRuleSet networkAcls() { return this.innerModel().networkAcls(); } @@ -172,6 +182,16 @@ public VolumeGroup refresh(Context context) { return this; } + public VolumeGroupImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateParameters.withIdentity(identity); + return this; + } + } + public VolumeGroupImpl withProtocolType(StorageTargetType protocolType) { if (isInCreateMode()) { this.innerModel().withProtocolType(protocolType); @@ -192,9 +212,24 @@ public VolumeGroupImpl withEncryption(EncryptionType encryption) { } } + public VolumeGroupImpl withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (isInCreateMode()) { + this.innerModel().withEncryptionProperties(encryptionProperties); + return this; + } else { + this.updateParameters.withEncryptionProperties(encryptionProperties); + return this; + } + } + public VolumeGroupImpl withNetworkAcls(NetworkRuleSet networkAcls) { - this.innerModel().withNetworkAcls(networkAcls); - return this; + if (isInCreateMode()) { + this.innerModel().withNetworkAcls(networkAcls); + return this; + } else { + this.updateParameters.withNetworkAcls(networkAcls); + return this; + } } private boolean isInCreateMode() { 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 index 7dfff63c066b..3b680f8e0d5d 100644 --- 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 @@ -4,9 +4,12 @@ package com.azure.resourcemanager.elasticsan.implementation; +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.ManagedByInfo; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.azure.resourcemanager.elasticsan.models.Volume; import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; @@ -28,6 +31,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String volumeId() { return this.innerModel().volumeId(); } @@ -44,6 +51,14 @@ public IscsiTargetInfo storageTarget() { return this.innerModel().storageTarget(); } + public ManagedByInfo managedBy() { + return this.innerModel().managedBy(); + } + + public ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + public String resourceGroupName() { return resourceGroupName; } @@ -160,8 +175,22 @@ public VolumeImpl withCreationData(SourceCreationData creationData) { return this; } + public VolumeImpl withManagedBy(ManagedByInfo managedBy) { + if (isInCreateMode()) { + this.innerModel().withManagedBy(managedBy); + return this; + } else { + this.updateParameters.withManagedBy(managedBy); + return this; + } + } + public VolumeImpl withSizeGiB(Long sizeGiB) { 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/VolumeSnapshotsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeSnapshotsClientImpl.java new file mode 100644 index 000000000000..d087427accbb --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeSnapshotsClientImpl.java @@ -0,0 +1,1250 @@ +// 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.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.VolumeSnapshotsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.SnapshotInner; +import com.azure.resourcemanager.elasticsan.models.SnapshotList; +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 VolumeSnapshotsClient. */ +public final class VolumeSnapshotsClientImpl implements VolumeSnapshotsClient { + /** The proxy service used to perform REST calls. */ + private final VolumeSnapshotsService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of VolumeSnapshotsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + VolumeSnapshotsClientImpl(ElasticSanManagementImpl client) { + this.service = + RestProxy.create(VolumeSnapshotsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementVolumeSnapshots to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + public interface VolumeSnapshotsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots") + @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("$filter") String filter, + @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}/snapshots/{snapshotName}") + @ExpectedResponses({200, 201}) + @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("snapshotName") String snapshotName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SnapshotInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/snapshots/{snapshotName}") + @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("snapshotName") String snapshotName, + @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}/snapshots/{snapshotName}") + @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("snapshotName") String snapshotName, + @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); + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVolumeGroupSinglePageAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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, + filter, + 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 Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByVolumeGroupSinglePageAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (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, + filter, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVolumeGroupAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter) { + return new PagedFlux<>( + () -> listByVolumeGroupSinglePageAsync(resourceGroupName, elasticSanName, volumeGroupName, filter), + nextLink -> listByVolumeGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 Snapshots as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVolumeGroupAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + final String filter = null; + return new PagedFlux<>( + () -> listByVolumeGroupSinglePageAsync(resourceGroupName, elasticSanName, volumeGroupName, filter), + nextLink -> listByVolumeGroupNextSinglePageAsync(nextLink)); + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByVolumeGroupAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter, Context context) { + return new PagedFlux<>( + () -> listByVolumeGroupSinglePageAsync(resourceGroupName, elasticSanName, volumeGroupName, filter, context), + nextLink -> listByVolumeGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 Snapshots as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + final String filter = null; + return new PagedIterable<>(listByVolumeGroupAsync(resourceGroupName, elasticSanName, volumeGroupName, filter)); + } + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter, Context context) { + return new PagedIterable<>( + listByVolumeGroupAsync(resourceGroupName, elasticSanName, volumeGroupName, filter, context)); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot 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 snapshotName, + SnapshotInner 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName 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, + snapshotName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot 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 snapshotName, + SnapshotInner 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName 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, + snapshotName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnapshotInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SnapshotInner.class, + SnapshotInner.class, + this.client.getContext()); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SnapshotInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SnapshotInner.class, SnapshotInner.class, context); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters) { + return this + .beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters) + .getSyncPoller(); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SnapshotInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters, + Context context) { + return this + .beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters, context) + .getSyncPoller(); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters) { + return createAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters).block(); + } + + /** + * Create a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param parameters Snapshot 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 Snapshot request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner create( + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String snapshotName, + SnapshotInner parameters, + Context context) { + return createAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, parameters, context) + .block(); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName 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, + snapshotName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName 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, + snapshotName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName) { + return this.beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName).getSyncPoller(); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context) + .getSyncPoller(); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 snapshotName, Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName).block(); + } + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context) { + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context).block(); + } + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName 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, + snapshotName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, 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 (snapshotName == null) { + return Mono.error(new IllegalArgumentException("Parameter snapshotName 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, + snapshotName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + return getWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context) { + return getWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context).block(); + } + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SnapshotInner get( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + return getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, Context.NONE) + .getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Snapshots 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/VolumeSnapshotsImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeSnapshotsImpl.java new file mode 100644 index 000000000000..0abca3dfa528 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeSnapshotsImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.VolumeSnapshotsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.SnapshotInner; +import com.azure.resourcemanager.elasticsan.models.Snapshot; +import com.azure.resourcemanager.elasticsan.models.VolumeSnapshots; + +public final class VolumeSnapshotsImpl implements VolumeSnapshots { + private static final ClientLogger LOGGER = new ClientLogger(VolumeSnapshotsImpl.class); + + private final VolumeSnapshotsClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public VolumeSnapshotsImpl( + VolumeSnapshotsClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName) { + PagedIterable inner = + this.serviceClient().listByVolumeGroup(resourceGroupName, elasticSanName, volumeGroupName); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByVolumeGroup(resourceGroupName, elasticSanName, volumeGroupName, filter, context); + return Utils.mapPage(inner, inner1 -> new SnapshotImpl(inner1, this.manager())); + } + + public void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, snapshotName); + } + + public void delete( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context) { + this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context); + } + + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SnapshotImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Snapshot get(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName) { + SnapshotInner inner = + this.serviceClient().get(resourceGroupName, elasticSanName, volumeGroupName, snapshotName); + if (inner != null) { + return new SnapshotImpl(inner, this.manager()); + } else { + return null; + } + } + + public Snapshot 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this + .getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + return this.getWithResponse(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.delete(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, 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 snapshotName = Utils.getValueFromIdByName(id, "snapshots"); + if (snapshotName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'snapshots'.", id))); + } + this.delete(resourceGroupName, elasticSanName, volumeGroupName, snapshotName, context); + } + + private VolumeSnapshotsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + public SnapshotImpl define(String name) { + return new SnapshotImpl(name, this.manager()); + } +} 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 index bd9812183c95..664702bf612b 100644 --- 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 @@ -36,6 +36,8 @@ import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; import com.azure.resourcemanager.elasticsan.models.VolumeList; import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; +import com.azure.resourcemanager.elasticsan.models.XMsDeleteSnapshots; +import com.azure.resourcemanager.elasticsan.models.XMsForceDelete; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -112,6 +114,8 @@ Mono>> delete( @PathParam("volumeGroupName") String volumeGroupName, @PathParam("volumeName") String volumeName, @QueryParam("api-version") String apiVersion, + @HeaderParam("x-ms-delete-snapshots") XMsDeleteSnapshots xMsDeleteSnapshots, + @HeaderParam("x-ms-force-delete") XMsForceDelete xMsForceDelete, @HeaderParam("Accept") String accept, Context context); @@ -866,6 +870,10 @@ public VolumeInner update( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -873,7 +881,12 @@ public VolumeInner update( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -913,6 +926,8 @@ private Mono>> deleteWithResponseAsync( volumeGroupName, volumeName, this.client.getApiVersion(), + xMsDeleteSnapshots, + xMsForceDelete, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -925,6 +940,10 @@ private Mono>> deleteWithResponseAsync( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -933,7 +952,13 @@ private Mono>> deleteWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -971,10 +996,45 @@ private Mono>> deleteWithResponseAsync( volumeGroupName, volumeName, this.client.getApiVersion(), + xMsDeleteSnapshots, + xMsForceDelete, 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. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, xMsDeleteSnapshots, xMsForceDelete); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + /** * Delete an Volume. * @@ -990,8 +1050,11 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { + final XMsDeleteSnapshots xMsDeleteSnapshots = null; + final XMsForceDelete xMsForceDelete = null; Mono>> mono = - deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName); + deleteWithResponseAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, xMsDeleteSnapshots, xMsForceDelete); return this .client .getLroResult( @@ -1005,6 +1068,10 @@ private PollerFlux, Void> beginDeleteAsync( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1013,10 +1080,23 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context) { context = this.client.mergeContext(context); Mono>> mono = - deleteWithResponseAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + deleteWithResponseAsync( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + xMsDeleteSnapshots, + xMsForceDelete, + context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); @@ -1037,7 +1117,12 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { - return this.beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).getSyncPoller(); + final XMsDeleteSnapshots xMsDeleteSnapshots = null; + final XMsForceDelete xMsForceDelete = null; + return this + .beginDeleteAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, xMsDeleteSnapshots, xMsForceDelete) + .getSyncPoller(); } /** @@ -1047,6 +1132,10 @@ public SyncPoller, Void> beginDelete( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1055,12 +1144,55 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context) { return this - .beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) + .beginDeleteAsync( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + xMsDeleteSnapshots, + xMsForceDelete, + 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. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete) { + return beginDeleteAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, xMsDeleteSnapshots, xMsForceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + /** * Delete an Volume. * @@ -1076,7 +1208,10 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { - return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName) + final XMsDeleteSnapshots xMsDeleteSnapshots = null; + final XMsForceDelete xMsForceDelete = null; + return beginDeleteAsync( + resourceGroupName, elasticSanName, volumeGroupName, volumeName, xMsDeleteSnapshots, xMsForceDelete) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1088,6 +1223,10 @@ private Mono deleteAsync( * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1096,8 +1235,21 @@ private Mono deleteAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { - return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context) { + return beginDeleteAsync( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + xMsDeleteSnapshots, + xMsForceDelete, + context) .last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1115,7 +1267,10 @@ private Mono deleteAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { - deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).block(); + final XMsDeleteSnapshots xMsDeleteSnapshots = null; + final XMsForceDelete xMsForceDelete = null; + deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, xMsDeleteSnapshots, xMsForceDelete) + .block(); } /** @@ -1125,6 +1280,10 @@ public void delete(String resourceGroupName, String elasticSanName, String volum * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1132,8 +1291,22 @@ public void delete(String resourceGroupName, String elasticSanName, String volum */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { - deleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context).block(); + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context) { + deleteAsync( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + xMsDeleteSnapshots, + xMsForceDelete, + context) + .block(); } /** 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 index 877c8da03fa0..cd1786bffe86 100644 --- 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 @@ -13,6 +13,8 @@ import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; import com.azure.resourcemanager.elasticsan.models.Volume; import com.azure.resourcemanager.elasticsan.models.Volumes; +import com.azure.resourcemanager.elasticsan.models.XMsDeleteSnapshots; +import com.azure.resourcemanager.elasticsan.models.XMsForceDelete; public final class VolumesImpl implements Volumes { private static final ClientLogger LOGGER = new ClientLogger(VolumesImpl.class); @@ -32,8 +34,23 @@ public void delete(String resourceGroupName, String elasticSanName, String volum } public void delete( - String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { - this.serviceClient().delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context) { + this + .serviceClient() + .delete( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + xMsDeleteSnapshots, + xMsForceDelete, + context); } public Response getWithResponse( @@ -174,10 +191,21 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); } - this.delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName, Context.NONE); + XMsDeleteSnapshots localXMsDeleteSnapshots = null; + XMsForceDelete localXMsForceDelete = null; + this + .delete( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + localXMsDeleteSnapshots, + localXMsForceDelete, + Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse( + String id, XMsDeleteSnapshots xMsDeleteSnapshots, XMsForceDelete xMsForceDelete, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER @@ -207,7 +235,15 @@ public void deleteByIdWithResponse(String id, Context context) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'volumes'.", id))); } - this.delete(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context); + this + .delete( + resourceGroupName, + elasticSanName, + volumeGroupName, + volumeName, + xMsDeleteSnapshots, + xMsForceDelete, + context); } private VolumesClient serviceClient() { 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 index c367079113ea..3c6beb2d5403 100644 --- 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 @@ -4,45 +4,41 @@ package com.azure.resourcemanager.elasticsan.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** The action of virtual network rule. */ -public enum Action { - /** Enum value Allow. */ - ALLOW("Allow"); +public final class Action extends ExpandableStringEnum { + /** Static value Allow for Action. */ + public static final Action ALLOW = fromString("Allow"); - /** The actual serialized value for a Action instance. */ - private final String value; - - Action(String value) { - this.value = value; + /** + * Creates a new instance of Action value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Action() { } /** - * Parses a serialized value to a Action instance. + * Creates or finds a Action from its string representation. * - * @param value the serialized value to parse. - * @return the parsed Action object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding Action. */ @JsonCreator - public static Action fromString(String value) { - if (value == null) { - return null; - } - Action[] items = Action.values(); - for (Action item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static Action fromString(String name) { + return fromString(name, Action.class); } - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known Action values. + * + * @return known Action values. + */ + public static Collection values() { + return values(Action.class); } } 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 index 8a4b9575b216..51eda3a2deee 100644 --- 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 @@ -132,6 +132,14 @@ public interface ElasticSan { */ List privateEndpointConnections(); + /** + * Gets the publicNetworkAccess property: Allow or disallow public network access to ElasticSan. Value is optional + * but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + /** * Gets the region of the resource. * @@ -244,7 +252,10 @@ interface WithExtendedCapacitySizeTiB { * 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.WithAvailabilityZones { + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithAvailabilityZones, + DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. * @@ -282,6 +293,19 @@ interface WithAvailabilityZones { */ WithCreate withAvailabilityZones(List availabilityZones); } + + /** The stage of the ElasticSan definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Allow or disallow public network access to ElasticSan. Value + * is optional but if passed in, must be 'Enabled' or 'Disabled'.. + * + * @param publicNetworkAccess Allow or disallow public network access to ElasticSan. Value is optional but + * if passed in, must be 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } } /** @@ -292,7 +316,11 @@ interface WithAvailabilityZones { ElasticSan.Update update(); /** The template for ElasticSan update. */ - interface Update extends UpdateStages.WithTags { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithBaseSizeTiB, + UpdateStages.WithExtendedCapacitySizeTiB, + UpdateStages.WithPublicNetworkAccess { /** * Executes the update request. * @@ -321,6 +349,41 @@ interface WithTags { */ Update withTags(Map tags); } + + /** The stage of the ElasticSan update 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. + */ + Update withBaseSizeTiB(Long baseSizeTiB); + } + + /** The stage of the ElasticSan update 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. + */ + Update withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB); + } + + /** The stage of the ElasticSan update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Allow or disallow public network access to ElasticSan + * Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.. + * + * @param publicNetworkAccess Allow or disallow public network access to ElasticSan Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } } /** 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 index 3f304a6ffc34..4c2aad57f6a4 100644 --- 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 @@ -105,6 +105,31 @@ public ElasticSanUpdate withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB return this; } + /** + * Get the publicNetworkAccess property: Allow or disallow public network access to ElasticSan Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Allow or disallow public network access to ElasticSan Account. Value is + * optional but if passed in, must be 'Enabled' or 'Disabled'. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the ElasticSanUpdate object itself. + */ + public ElasticSanUpdate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new ElasticSanUpdateProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + /** * Validates the instance. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionIdentity.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionIdentity.java new file mode 100644 index 000000000000..e371ae2b00cc --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionIdentity.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.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Encryption identity for the volume group. */ +@Fluent +public final class EncryptionIdentity { + /* + * Resource identifier of the UserAssigned identity to be associated with server-side encryption on the volume + * group. + */ + @JsonProperty(value = "userAssignedIdentity") + private String encryptionUserAssignedIdentity; + + /** Creates an instance of EncryptionIdentity class. */ + public EncryptionIdentity() { + } + + /** + * Get the encryptionUserAssignedIdentity property: Resource identifier of the UserAssigned identity to be + * associated with server-side encryption on the volume group. + * + * @return the encryptionUserAssignedIdentity value. + */ + public String encryptionUserAssignedIdentity() { + return this.encryptionUserAssignedIdentity; + } + + /** + * Set the encryptionUserAssignedIdentity property: Resource identifier of the UserAssigned identity to be + * associated with server-side encryption on the volume group. + * + * @param encryptionUserAssignedIdentity the encryptionUserAssignedIdentity value to set. + * @return the EncryptionIdentity object itself. + */ + public EncryptionIdentity withEncryptionUserAssignedIdentity(String encryptionUserAssignedIdentity) { + this.encryptionUserAssignedIdentity = encryptionUserAssignedIdentity; + 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/EncryptionProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionProperties.java new file mode 100644 index 000000000000..76fad9fc5562 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionProperties.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The encryption settings on the volume group. */ +@Fluent +public final class EncryptionProperties { + /* + * Properties provided by key vault. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /* + * The identity to be used with service-side encryption at rest. + */ + @JsonProperty(value = "identity") + private EncryptionIdentity encryptionIdentity; + + /** Creates an instance of EncryptionProperties class. */ + public EncryptionProperties() { + } + + /** + * Get the keyVaultProperties property: Properties provided by key vault. + * + * @return the keyVaultProperties value. + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: Properties provided by key vault. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the encryptionIdentity property: The identity to be used with service-side encryption at rest. + * + * @return the encryptionIdentity value. + */ + public EncryptionIdentity encryptionIdentity() { + return this.encryptionIdentity; + } + + /** + * Set the encryptionIdentity property: The identity to be used with service-side encryption at rest. + * + * @param encryptionIdentity the encryptionIdentity value to set. + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withEncryptionIdentity(EncryptionIdentity encryptionIdentity) { + this.encryptionIdentity = encryptionIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().validate(); + } + if (encryptionIdentity() != null) { + encryptionIdentity().validate(); + } + } +} 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 index d5c9323890a1..857db2ecddcc 100644 --- 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 @@ -14,6 +14,10 @@ public final class EncryptionType extends ExpandableStringEnum { public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = fromString("EncryptionAtRestWithPlatformKey"); + /** Static value EncryptionAtRestWithCustomerManagedKey for EncryptionType. */ + public static final EncryptionType ENCRYPTION_AT_REST_WITH_CUSTOMER_MANAGED_KEY = + fromString("EncryptionAtRestWithCustomerManagedKey"); + /** * Creates a new instance of EncryptionType value. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Identity.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Identity.java new file mode 100644 index 000000000000..27123c6ad37b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Identity.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Identity for the resource. */ +@Fluent +public final class Identity { + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /* + * The identity type. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /* + * Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with + * this volume group. The key is the ARM resource identifier of the identity. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of Identity class. */ + public Identity() { + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The identity type. + * + * @return the type value. + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type property: The identity type. + * + * @param type the type value to set. + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Gets or sets a list of key value pairs that describe the set of User + * Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the + * identity. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Gets or sets a list of key value pairs that describe the set of User + * Assigned identities that will be used with this volume group. The key is the ARM resource identifier of the + * identity. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Missing required property type in model Identity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(Identity.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IdentityType.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IdentityType.java new file mode 100644 index 000000000000..39c198aa8e96 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/IdentityType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The identity type. */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value None for IdentityType. */ + public static final IdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityType. */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates a new instance of IdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityType() { + } + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** + * Gets known IdentityType values. + * + * @return known IdentityType values. + */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/KeyVaultProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/KeyVaultProperties.java new file mode 100644 index 000000000000..302d33c24dff --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/KeyVaultProperties.java @@ -0,0 +1,151 @@ +// 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.time.OffsetDateTime; + +/** Properties of key vault. */ +@Fluent +public final class KeyVaultProperties { + /* + * The name of KeyVault key. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /* + * The version of KeyVault key. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /* + * The Uri of KeyVault. + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /* + * The object identifier of the current versioned Key Vault Key in use. + */ + @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String currentVersionedKeyIdentifier; + + /* + * Timestamp of last rotation of the Key Vault Key. + */ + @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastKeyRotationTimestamp; + + /* + * This is a read only property that represents the expiration time of the current version of the customer managed + * key used for encryption. + */ + @JsonProperty(value = "currentVersionedKeyExpirationTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime currentVersionedKeyExpirationTimestamp; + + /** Creates an instance of KeyVaultProperties class. */ + public KeyVaultProperties() { + } + + /** + * Get the keyName property: The name of KeyVault key. + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of KeyVault key. + * + * @param keyName the keyName value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the keyVersion property: The version of KeyVault key. + * + * @return the keyVersion value. + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the keyVersion property: The version of KeyVault key. + * + * @param keyVersion the keyVersion value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + /** + * Get the keyVaultUri property: The Uri of KeyVault. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Uri of KeyVault. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the currentVersionedKeyIdentifier property: The object identifier of the current versioned Key Vault Key in + * use. + * + * @return the currentVersionedKeyIdentifier value. + */ + public String currentVersionedKeyIdentifier() { + return this.currentVersionedKeyIdentifier; + } + + /** + * Get the lastKeyRotationTimestamp property: Timestamp of last rotation of the Key Vault Key. + * + * @return the lastKeyRotationTimestamp value. + */ + public OffsetDateTime lastKeyRotationTimestamp() { + return this.lastKeyRotationTimestamp; + } + + /** + * Get the currentVersionedKeyExpirationTimestamp property: This is a read only property that represents the + * expiration time of the current version of the customer managed key used for encryption. + * + * @return the currentVersionedKeyExpirationTimestamp value. + */ + public OffsetDateTime currentVersionedKeyExpirationTimestamp() { + return this.currentVersionedKeyExpirationTimestamp; + } + + /** + * 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/ManagedByInfo.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ManagedByInfo.java new file mode 100644 index 000000000000..35e4cb3b50ef --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ManagedByInfo.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.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parent resource information. */ +@Fluent +public final class ManagedByInfo { + /* + * Resource ID of the resource managing the volume, this is a restricted field and can only be set for internal + * use. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** Creates an instance of ManagedByInfo class. */ + public ManagedByInfo() { + } + + /** + * Get the resourceId property: Resource ID of the resource managing the volume, this is a restricted field and can + * only be set for internal use. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource ID of the resource managing the volume, this is a restricted field and can + * only be set for internal use. + * + * @param resourceId the resourceId value to set. + * @return the ManagedByInfo object itself. + */ + public ManagedByInfo withResourceId(String resourceId) { + this.resourceId = resourceId; + 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/PublicNetworkAccess.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PublicNetworkAccess.java new file mode 100644 index 000000000000..2871fd6ddde3 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PublicNetworkAccess.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Allow or disallow public network access to ElasticSan. Value is optional but if passed in, must be 'Enabled' or + * 'Disabled'. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Snapshot.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Snapshot.java new file mode 100644 index 000000000000..fc927a14c3a4 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Snapshot.java @@ -0,0 +1,151 @@ +// 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.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.SnapshotInner; + +/** An immutable client-side representation of Snapshot. */ +public interface Snapshot { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the creationData property: Data used when creating a volume snapshot. + * + * @return the creationData value. + */ + SnapshotCreationData creationData(); + + /** + * Gets the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + + /** + * Gets the sourceVolumeSizeGiB property: Size of Source Volume. + * + * @return the sourceVolumeSizeGiB value. + */ + Long sourceVolumeSizeGiB(); + + /** + * Gets the volumeName property: Source Volume Name of a snapshot. + * + * @return the volumeName value. + */ + String volumeName(); + + /** + * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.SnapshotInner object. + * + * @return the inner object. + */ + SnapshotInner innerModel(); + + /** The entirety of the Snapshot definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreationData, + DefinitionStages.WithCreate { + } + + /** The Snapshot definition stages. */ + interface DefinitionStages { + /** The first stage of the Snapshot definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the Snapshot 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. + */ + WithCreationData withExistingVolumegroup( + String resourceGroupName, String elasticSanName, String volumeGroupName); + } + + /** The stage of the Snapshot definition allowing to specify creationData. */ + interface WithCreationData { + /** + * Specifies the creationData property: Data used when creating a volume snapshot.. + * + * @param creationData Data used when creating a volume snapshot. + * @return the next definition stage. + */ + WithCreate withCreationData(SnapshotCreationData creationData); + } + + /** + * The stage of the Snapshot 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + Snapshot create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Snapshot create(Context context); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Snapshot refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Snapshot refresh(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotCreationData.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotCreationData.java new file mode 100644 index 000000000000..40085196b725 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotCreationData.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 volume snapshot. */ +@Fluent +public final class SnapshotCreationData { + /* + * Fully qualified resource ID of the volume. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" + */ + @JsonProperty(value = "sourceId", required = true) + private String sourceId; + + /** Creates an instance of SnapshotCreationData class. */ + public SnapshotCreationData() { + } + + /** + * Get the sourceId property: Fully qualified resource ID of the volume. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}". + * + * @return the sourceId value. + */ + public String sourceId() { + return this.sourceId; + } + + /** + * Set the sourceId property: Fully qualified resource ID of the volume. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}". + * + * @param sourceId the sourceId value to set. + * @return the SnapshotCreationData object itself. + */ + public SnapshotCreationData withSourceId(String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property sourceId in model SnapshotCreationData")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SnapshotCreationData.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotList.java new file mode 100644 index 000000000000..ec07d609b8b0 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SnapshotList.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.fluent.models.SnapshotInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of Snapshots. */ +@Fluent +public final class SnapshotList { + /* + * An array of Snapshot objects. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URI to fetch the next section of the paginated response. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of SnapshotList class. */ + public SnapshotList() { + } + + /** + * Get the value property: An array of Snapshot objects. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: An array of Snapshot objects. + * + * @param value the value value to set. + * @return the SnapshotList object itself. + */ + public SnapshotList 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) { + value().forEach(e -> e.validate()); + } + } +} 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 index 5cee7328ec3c..54085f1ff04e 100644 --- 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 @@ -17,11 +17,11 @@ public final class SourceCreationData { 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. + * Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" */ - @JsonProperty(value = "sourceUri") - private String sourceUri; + @JsonProperty(value = "sourceId") + private String sourceId; /** Creates an instance of SourceCreationData class. */ public SourceCreationData() { @@ -48,24 +48,24 @@ public SourceCreationData withCreateSource(VolumeCreateOption createSource) { } /** - * 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. + * Get the sourceId property: Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". * - * @return the sourceUri value. + * @return the sourceId value. */ - public String sourceUri() { - return this.sourceUri; + public String sourceId() { + return this.sourceId; } /** - * 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. + * Set the sourceId property: Fully qualified resource ID for the resource. E.g. + * "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". * - * @param sourceUri the sourceUri value to set. + * @param sourceId the sourceId value to set. * @return the SourceCreationData object itself. */ - public SourceCreationData withSourceUri(String sourceUri) { - this.sourceUri = sourceUri; + public SourceCreationData withSourceId(String sourceId) { + this.sourceId = sourceId; return this; } 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 deleted file mode 100644 index 53216005087f..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/State.java +++ /dev/null @@ -1,60 +0,0 @@ -// 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; - -/** Gets the state of virtual network rule. */ -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) { - if (value == null) { - return null; - } - State[] items = State.values(); - for (State item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/UserAssignedIdentity.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..7e5529fde74a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/UserAssignedIdentity.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** UserAssignedIdentity for the resource. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The client ID of the identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/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 index d3e405d6166f..701b63b377ac 100644 --- 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 @@ -24,12 +24,6 @@ public final class VirtualNetworkRule { @JsonProperty(value = "action") private Action action; - /* - * Gets the state of virtual network rule. - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private State state; - /** Creates an instance of VirtualNetworkRule class. */ public VirtualNetworkRule() { } @@ -76,15 +70,6 @@ public VirtualNetworkRule withAction(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. * 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 index 679d3e406135..07e6a0f2d3d8 100644 --- 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.elasticsan.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; @@ -30,6 +31,13 @@ public interface Volume { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the volumeId property: Unique Id of the volume in GUID format. * @@ -58,6 +66,20 @@ public interface Volume { */ IscsiTargetInfo storageTarget(); + /** + * Gets the managedBy property: Parent resource information. + * + * @return the managedBy value. + */ + ManagedByInfo managedBy(); + + /** + * Gets the provisioningState property: State of the operation on the resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + /** * Gets the name of the resource group. * @@ -115,7 +137,7 @@ interface WithSizeGiB { * 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.WithCreationData { + interface WithCreate extends DefinitionStages.WithCreationData, DefinitionStages.WithManagedBy { /** * Executes the create request. * @@ -142,6 +164,17 @@ interface WithCreationData { */ WithCreate withCreationData(SourceCreationData creationData); } + + /** The stage of the Volume definition allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: Parent resource information.. + * + * @param managedBy Parent resource information. + * @return the next definition stage. + */ + WithCreate withManagedBy(ManagedByInfo managedBy); + } } /** @@ -152,7 +185,7 @@ interface WithCreationData { Volume.Update update(); /** The template for Volume update. */ - interface Update extends UpdateStages.WithSizeGiB { + interface Update extends UpdateStages.WithSizeGiB, UpdateStages.WithManagedBy { /** * Executes the update request. * @@ -181,6 +214,17 @@ interface WithSizeGiB { */ Update withSizeGiB(Long sizeGiB); } + + /** The stage of the Volume update allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: Parent resource information.. + * + * @param managedBy Parent resource information. + * @return the next definition stage. + */ + Update withManagedBy(ManagedByInfo managedBy); + } } /** 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 index e3be7388ec4b..b1e3bb47dd5d 100644 --- 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 @@ -4,45 +4,53 @@ package com.azure.resourcemanager.elasticsan.models; +import com.azure.core.util.ExpandableStringEnum; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Collection; /** This enumerates the possible sources of a volume creation. */ -public enum VolumeCreateOption { - /** Enum value None. */ - NONE("None"); +public final class VolumeCreateOption extends ExpandableStringEnum { + /** Static value None for VolumeCreateOption. */ + public static final VolumeCreateOption NONE = fromString("None"); - /** The actual serialized value for a VolumeCreateOption instance. */ - private final String value; + /** Static value VolumeSnapshot for VolumeCreateOption. */ + public static final VolumeCreateOption VOLUME_SNAPSHOT = fromString("VolumeSnapshot"); - VolumeCreateOption(String value) { - this.value = value; + /** Static value DiskSnapshot for VolumeCreateOption. */ + public static final VolumeCreateOption DISK_SNAPSHOT = fromString("DiskSnapshot"); + + /** Static value Disk for VolumeCreateOption. */ + public static final VolumeCreateOption DISK = fromString("Disk"); + + /** Static value DiskRestorePoint for VolumeCreateOption. */ + public static final VolumeCreateOption DISK_RESTORE_POINT = fromString("DiskRestorePoint"); + + /** + * Creates a new instance of VolumeCreateOption value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VolumeCreateOption() { } /** - * Parses a serialized value to a VolumeCreateOption instance. + * Creates or finds a VolumeCreateOption from its string representation. * - * @param value the serialized value to parse. - * @return the parsed VolumeCreateOption object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding VolumeCreateOption. */ @JsonCreator - public static VolumeCreateOption fromString(String value) { - if (value == null) { - return null; - } - VolumeCreateOption[] items = VolumeCreateOption.values(); - for (VolumeCreateOption item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static VolumeCreateOption fromString(String name) { + return fromString(name, VolumeCreateOption.class); } - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; + /** + * Gets known VolumeCreateOption values. + * + * @return known VolumeCreateOption values. + */ + public static Collection values() { + return values(VolumeCreateOption.class); } } 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 index 5fe4a1ba19cc..be7cd2589723 100644 --- 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 @@ -32,6 +32,13 @@ public interface VolumeGroup { */ String type(); + /** + * Gets the identity property: The identity of the resource. + * + * @return the identity value. + */ + Identity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -60,6 +67,13 @@ public interface VolumeGroup { */ EncryptionType encryption(); + /** + * Gets the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @return the encryptionProperties value. + */ + EncryptionProperties encryptionProperties(); + /** * Gets the networkAcls property: A collection of rules governing the accessibility from specific network locations. * @@ -116,8 +130,10 @@ interface WithParentResource { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithProtocolType, + extends DefinitionStages.WithIdentity, + DefinitionStages.WithProtocolType, DefinitionStages.WithEncryption, + DefinitionStages.WithEncryptionProperties, DefinitionStages.WithNetworkAcls { /** * Executes the create request. @@ -135,6 +151,17 @@ interface WithCreate VolumeGroup create(Context context); } + /** The stage of the VolumeGroup definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(Identity identity); + } + /** The stage of the VolumeGroup definition allowing to specify protocolType. */ interface WithProtocolType { /** @@ -157,6 +184,18 @@ interface WithEncryption { WithCreate withEncryption(EncryptionType encryption); } + /** The stage of the VolumeGroup definition allowing to specify encryptionProperties. */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: Encryption Properties describing Key Vault and Identity + * information. + * + * @param encryptionProperties Encryption Properties describing Key Vault and Identity information. + * @return the next definition stage. + */ + WithCreate withEncryptionProperties(EncryptionProperties encryptionProperties); + } + /** The stage of the VolumeGroup definition allowing to specify networkAcls. */ interface WithNetworkAcls { /** @@ -178,7 +217,12 @@ interface WithNetworkAcls { VolumeGroup.Update update(); /** The template for VolumeGroup update. */ - interface Update extends UpdateStages.WithProtocolType, UpdateStages.WithEncryption { + interface Update + extends UpdateStages.WithIdentity, + UpdateStages.WithProtocolType, + UpdateStages.WithEncryption, + UpdateStages.WithEncryptionProperties, + UpdateStages.WithNetworkAcls { /** * Executes the update request. * @@ -197,6 +241,17 @@ interface Update extends UpdateStages.WithProtocolType, UpdateStages.WithEncrypt /** The VolumeGroup update stages. */ interface UpdateStages { + /** The stage of the VolumeGroup update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the resource.. + * + * @param identity The identity of the resource. + * @return the next definition stage. + */ + Update withIdentity(Identity identity); + } + /** The stage of the VolumeGroup update allowing to specify protocolType. */ interface WithProtocolType { /** @@ -218,6 +273,30 @@ interface WithEncryption { */ Update withEncryption(EncryptionType encryption); } + + /** The stage of the VolumeGroup update allowing to specify encryptionProperties. */ + interface WithEncryptionProperties { + /** + * Specifies the encryptionProperties property: Encryption Properties describing Key Vault and Identity + * information. + * + * @param encryptionProperties Encryption Properties describing Key Vault and Identity information. + * @return the next definition stage. + */ + Update withEncryptionProperties(EncryptionProperties encryptionProperties); + } + + /** The stage of the VolumeGroup update 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. + */ + Update withNetworkAcls(NetworkRuleSet networkAcls); + } } /** 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 index 2e44d8ae2e14..f1127d3a8506 100644 --- 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 @@ -11,6 +11,12 @@ /** Volume Group request. */ @Fluent public final class VolumeGroupUpdate { + /* + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + /* * Properties of VolumeGroup. */ @@ -21,6 +27,26 @@ public final class VolumeGroupUpdate { public VolumeGroupUpdate() { } + /** + * Get the identity property: The identity of the resource. + * + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the resource. + * + * @param identity the identity value to set. + * @return the VolumeGroupUpdate object itself. + */ + public VolumeGroupUpdate withIdentity(Identity identity) { + this.identity = identity; + return this; + } + /** * Get the innerProperties property: Properties of VolumeGroup. * @@ -76,6 +102,29 @@ public VolumeGroupUpdate withEncryption(EncryptionType encryption) { return this; } + /** + * Get the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @return the encryptionProperties value. + */ + public EncryptionProperties encryptionProperties() { + return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties(); + } + + /** + * Set the encryptionProperties property: Encryption Properties describing Key Vault and Identity information. + * + * @param encryptionProperties the encryptionProperties value to set. + * @return the VolumeGroupUpdate object itself. + */ + public VolumeGroupUpdate withEncryptionProperties(EncryptionProperties encryptionProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeGroupUpdateProperties(); + } + this.innerProperties().withEncryptionProperties(encryptionProperties); + return this; + } + /** * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. * @@ -105,6 +154,9 @@ public VolumeGroupUpdate withNetworkAcls(NetworkRuleSet networkAcls) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeSnapshots.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeSnapshots.java new file mode 100644 index 000000000000..4008be9899f5 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeSnapshots.java @@ -0,0 +1,151 @@ +// 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 VolumeSnapshots. */ +public interface VolumeSnapshots { + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 Snapshots as paginated response with {@link PagedIterable}. + */ + PagedIterable listByVolumeGroup(String resourceGroupName, String elasticSanName, String volumeGroupName); + + /** + * List Snapshots in a VolumeGroup or List Snapshots by Volume (name) in a VolumeGroup using filter. + * + * @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 filter Specify $filter='volumeName eq <volume name>' to filter on 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 list of Snapshots as paginated response with {@link PagedIterable}. + */ + PagedIterable listByVolumeGroup( + String resourceGroupName, String elasticSanName, String volumeGroupName, String filter, Context context); + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName); + + /** + * Delete a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context); + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName, Context context); + + /** + * Get a Volume Snapshot. + * + * @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 snapshotName The name of the volume snapshot within the given volume group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Volume Snapshot. + */ + Snapshot get(String resourceGroupName, String elasticSanName, String volumeGroupName, String snapshotName); + + /** + * Get a Volume Snapshot. + * + * @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 Volume Snapshot along with {@link Response}. + */ + Snapshot getById(String id); + + /** + * Get a Volume Snapshot. + * + * @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 Volume Snapshot along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Volume Snapshot. + * + * @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 Volume Snapshot. + * + * @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 Snapshot resource. + * + * @param name resource name. + * @return the first stage of the new Snapshot definition. + */ + Snapshot.DefinitionStages.Blank define(String name); +} 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 index 2113a831b4cd..eca23bdd3220 100644 --- 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 @@ -53,6 +53,29 @@ public VolumeUpdate withSizeGiB(Long sizeGiB) { return this; } + /** + * Get the managedBy property: Parent resource information. + * + * @return the managedBy value. + */ + public ManagedByInfo managedBy() { + return this.innerProperties() == null ? null : this.innerProperties().managedBy(); + } + + /** + * Set the managedBy property: Parent resource information. + * + * @param managedBy the managedBy value to set. + * @return the VolumeUpdate object itself. + */ + public VolumeUpdate withManagedBy(ManagedByInfo managedBy) { + if (this.innerProperties() == null) { + this.innerProperties = new VolumeUpdateProperties(); + } + this.innerProperties().withManagedBy(managedBy); + return this; + } + /** * Validates the instance. * 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 index 57a0133f6374..874dece1e4a4 100644 --- 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 @@ -30,13 +30,23 @@ public interface Volumes { * @param elasticSanName The name of the ElasticSan. * @param volumeGroupName The name of the VolumeGroup. * @param volumeName The name of the Volume. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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); + String resourceGroupName, + String elasticSanName, + String volumeGroupName, + String volumeName, + XMsDeleteSnapshots xMsDeleteSnapshots, + XMsForceDelete xMsForceDelete, + Context context); /** * Get an Volume. @@ -133,12 +143,17 @@ PagedIterable listByVolumeGroup( * Delete an Volume. * * @param id the resource ID. + * @param xMsDeleteSnapshots Optional, used to delete snapshots under volume. Allowed value are only true or false. + * Default value is false. + * @param xMsForceDelete Optional, used to delete volume if active sessions present. Allowed value are only true or + * false. Default value is false. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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); + void deleteByIdWithResponse( + String id, XMsDeleteSnapshots xMsDeleteSnapshots, XMsForceDelete xMsForceDelete, Context context); /** * Begins definition for a new Volume resource. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsDeleteSnapshots.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsDeleteSnapshots.java new file mode 100644 index 000000000000..4d7cf0e13ee7 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsDeleteSnapshots.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for XMsDeleteSnapshots. */ +public final class XMsDeleteSnapshots extends ExpandableStringEnum { + /** Static value true for XMsDeleteSnapshots. */ + public static final XMsDeleteSnapshots TRUE = fromString("true"); + + /** Static value false for XMsDeleteSnapshots. */ + public static final XMsDeleteSnapshots FALSE = fromString("false"); + + /** + * Creates a new instance of XMsDeleteSnapshots value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public XMsDeleteSnapshots() { + } + + /** + * Creates or finds a XMsDeleteSnapshots from its string representation. + * + * @param name a name to look for. + * @return the corresponding XMsDeleteSnapshots. + */ + @JsonCreator + public static XMsDeleteSnapshots fromString(String name) { + return fromString(name, XMsDeleteSnapshots.class); + } + + /** + * Gets known XMsDeleteSnapshots values. + * + * @return known XMsDeleteSnapshots values. + */ + public static Collection values() { + return values(XMsDeleteSnapshots.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsForceDelete.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsForceDelete.java new file mode 100644 index 000000000000..70e875a2c851 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/XMsForceDelete.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for XMsForceDelete. */ +public final class XMsForceDelete extends ExpandableStringEnum { + /** Static value true for XMsForceDelete. */ + public static final XMsForceDelete TRUE = fromString("true"); + + /** Static value false for XMsForceDelete. */ + public static final XMsForceDelete FALSE = fromString("false"); + + /** + * Creates a new instance of XMsForceDelete value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public XMsForceDelete() { + } + + /** + * Creates or finds a XMsForceDelete from its string representation. + * + * @param name a name to look for. + * @return the corresponding XMsForceDelete. + */ + @JsonCreator + public static XMsForceDelete fromString(String name) { + return fromString(name, XMsForceDelete.class); + } + + /** + * Gets known XMsForceDelete values. + * + * @return known XMsForceDelete values. + */ + public static Collection values() { + return values(XMsForceDelete.class); + } +} 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 index 28b59cf54a2f..21952cb796f7 100644 --- 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.elasticsan.generated; +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; import com.azure.resourcemanager.elasticsan.models.Sku; import com.azure.resourcemanager.elasticsan.models.SkuName; import com.azure.resourcemanager.elasticsan.models.SkuTier; @@ -14,7 +15,7 @@ /** Samples for ElasticSans Create. */ public final class ElasticSansCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MaximumSet_Gen. @@ -25,18 +26,19 @@ public static void elasticSansCreateMaximumSetGen(com.azure.resourcemanager.elas manager .elasticSans() .define("elasticsanname") - .withRegion("South Central US") + .withRegion("France Central") .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) .withBaseSizeTiB(5L) .withExtendedCapacitySizeTiB(25L) .withTags(mapOf("key9316", "fakeTokenPlaceholder")) .withAvailabilityZones(Arrays.asList("1")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MinimumSet_Gen. @@ -47,14 +49,15 @@ public static void elasticSansCreateMinimumSetGen(com.azure.resourcemanager.elas manager .elasticSans() .define("elasticsanname") - .withRegion("South Central US") + .withRegion("France Central") .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) - .withBaseSizeTiB(5L) - .withExtendedCapacitySizeTiB(25L) + .withBaseSizeTiB(15L) + .withExtendedCapacitySizeTiB(27L) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 index 1aaa79bd0765..c4426aca362d 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for ElasticSans Delete. */ public final class ElasticSansDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MinimumSet_Gen. @@ -19,7 +19,7 @@ public static void elasticSansDeleteMinimumSetGen(com.azure.resourcemanager.elas } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MaximumSet_Gen. 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 index 87c4bea3033a..7d66d8e67975 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for ElasticSans GetByResourceGroup. */ public final class ElasticSansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MinimumSet_Gen. @@ -21,7 +21,7 @@ public static void elasticSansGetMinimumSetGen(com.azure.resourcemanager.elastic } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MaximumSet_Gen. 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 index 9f73e5041e1e..e5c46ed6b3fc 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for ElasticSans ListByResourceGroup. */ public final class ElasticSansListByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MinimumSet_Gen. @@ -20,7 +20,7 @@ public static void elasticSansListByResourceGroupMinimumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen. 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 index 0db886cd355e..0f7a03c17351 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for ElasticSans List. */ public final class ElasticSansListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen. @@ -20,7 +20,7 @@ public static void elasticSansListBySubscriptionMaximumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MinimumSet_Gen. 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 index 5dc2c94f2029..1e9fc954e434 100644 --- 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 @@ -5,13 +5,14 @@ package com.azure.resourcemanager.elasticsan.generated; import com.azure.resourcemanager.elasticsan.models.ElasticSan; +import com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess; 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/2022-12-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MinimumSet_Gen. @@ -28,7 +29,7 @@ public static void elasticSansUpdateMinimumSetGen(com.azure.resourcemanager.elas } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MaximumSet_Gen. @@ -41,9 +42,16 @@ public static void elasticSansUpdateMaximumSetGen(com.azure.resourcemanager.elas .elasticSans() .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("key4212", "fakeTokenPlaceholder")).apply(); + resource + .update() + .withTags(mapOf("key1931", "fakeTokenPlaceholder")) + .withBaseSizeTiB(13L) + .withExtendedCapacitySizeTiB(29L) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 index 9d24e55e821c..283030dbf7ed 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -19,7 +19,7 @@ public static void operationsListMinimumSetGen(com.azure.resourcemanager.elastic } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateSamples.java index a5316575ab01..1cc36dad8d1d 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateSamples.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateSamples.java @@ -12,7 +12,7 @@ /** Samples for PrivateEndpointConnections Create. */ public final class PrivateEndpointConnectionsCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Create_MaximumSet_Gen. @@ -28,15 +28,15 @@ public static void privateEndpointConnectionsCreateMaximumSetGen( .withPrivateLinkServiceConnectionState( new PrivateLinkServiceConnectionState() .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("Auto-Approved") - .withActionsRequired("None")) + .withDescription("dxl") + .withActionsRequired("jhjdpwvyzipggtn")) .withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("sytxzqlcoapcaywthgwvwcw")) + .withGroupIds(Arrays.asList("jdwrzpemdjrpiwzvy")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Create_MinimumSet_Gen. @@ -49,11 +49,7 @@ public static void privateEndpointConnectionsCreateMinimumSetGen( .privateEndpointConnections() .define("privateendpointconnectionname") .withExistingElasticSan("resourcegroupname", "elasticsanname") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("Auto-Approved") - .withActionsRequired("None")) + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState()) .create(); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteSamples.java index e2b7a8301887..1b92108127f4 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Delete_MaximumSet_Gen. @@ -26,7 +26,7 @@ public static void privateEndpointConnectionsDeleteMaximumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Delete_MinimumSet_Gen. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetSamples.java index 4e490d926fbd..46d8b8be13b3 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Get_MinimumSet_Gen. @@ -26,7 +26,7 @@ public static void privateEndpointConnectionsGetMinimumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_Get_MaximumSet_Gen. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListSamples.java index 1ca2a21af283..686a108bd6fd 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_List_MinimumSet_Gen. @@ -22,7 +22,7 @@ public static void privateEndpointConnectionsListMinimumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json */ /** * Sample code: PrivateEndpointConnections_List_MaximumSet_Gen. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanSamples.java index a858cb253039..0ec0f71797ad 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanSamples.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources ListByElasticSan. */ public final class PrivateLinkResourcesListByElasticSanSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json */ /** * Sample code: PrivateLinkResources_ListByElasticSan_MinimumSet_Gen. @@ -22,7 +22,7 @@ public static void privateLinkResourcesListByElasticSanMinimumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json */ /** * Sample code: PrivateLinkResources_ListByElasticSan_MaximumSet_Gen. 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 index a1ebf18f87b6..1137381a3dd1 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for Skus List. */ public final class SkusListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MinimumSet_Gen.json */ /** * Sample code: Skus_List_MinimumSet_Gen. @@ -19,7 +19,7 @@ public static void skusListMinimumSetGen(com.azure.resourcemanager.elasticsan.El } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MaximumSet_Gen.json */ /** * Sample code: Skus_List_MaximumSet_Gen. @@ -27,6 +27,6 @@ public static void skusListMinimumSetGen(com.azure.resourcemanager.elasticsan.El * @param manager Entry point to ElasticSanManager. */ public static void skusListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.skus().list("dtycml", com.azure.core.util.Context.NONE); + manager.skus().list("obwwdrkq", com.azure.core.util.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 index aa7ea8db0ccc..94ab9e8bbb80 100644 --- 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 @@ -5,16 +5,24 @@ package com.azure.resourcemanager.elasticsan.generated; import com.azure.resourcemanager.elasticsan.models.Action; +import com.azure.resourcemanager.elasticsan.models.EncryptionIdentity; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.Identity; +import com.azure.resourcemanager.elasticsan.models.IdentityType; +import com.azure.resourcemanager.elasticsan.models.KeyVaultProperties; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.UserAssignedIdentity; 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/2022-12-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MinimumSet_Gen. @@ -30,7 +38,7 @@ public static void volumeGroupsCreateMinimumSetGen(com.azure.resourcemanager.ela } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MaximumSet_Gen. @@ -42,8 +50,20 @@ public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.ela .volumeGroups() .define("volumegroupname") .withExistingElasticSan("resourcegroupname", "elasticsanname") + .withIdentity( + new Identity() + .withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("key7482", new UserAssignedIdentity()))) .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_CUSTOMER_MANAGED_KEY) + .withEncryptionProperties( + new EncryptionProperties() + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity("im"))) .withNetworkAcls( new NetworkRuleSet() .withVirtualNetworkRules( @@ -55,4 +75,16 @@ public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.ela .withAction(Action.ALLOW)))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/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 index 7b670f975010..c82289f1c2fe 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for VolumeGroups Delete. */ public final class VolumeGroupsDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MinimumSet_Gen. @@ -21,7 +21,7 @@ public static void volumeGroupsDeleteMinimumSetGen(com.azure.resourcemanager.ela } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MaximumSet_Gen. 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 index db858e1eef0c..734ad19a76f2 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for VolumeGroups Get. */ public final class VolumeGroupsGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MinimumSet_Gen. @@ -22,7 +22,7 @@ public static void volumeGroupsGetMinimumSetGen(com.azure.resourcemanager.elasti } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MaximumSet_Gen. 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 index fc557b4cec54..e649dc260656 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for VolumeGroups ListByElasticSan. */ public final class VolumeGroupsListByElasticSanSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen. @@ -22,7 +22,7 @@ public static void volumeGroupsListByElasticSanMinimumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen. 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 index 5b767c456c00..5ca1a58547a8 100644 --- 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 @@ -4,14 +4,26 @@ package com.azure.resourcemanager.elasticsan.generated; +import com.azure.resourcemanager.elasticsan.models.Action; +import com.azure.resourcemanager.elasticsan.models.EncryptionIdentity; +import com.azure.resourcemanager.elasticsan.models.EncryptionProperties; import com.azure.resourcemanager.elasticsan.models.EncryptionType; +import com.azure.resourcemanager.elasticsan.models.Identity; +import com.azure.resourcemanager.elasticsan.models.IdentityType; +import com.azure.resourcemanager.elasticsan.models.KeyVaultProperties; +import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; +import com.azure.resourcemanager.elasticsan.models.UserAssignedIdentity; +import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; import com.azure.resourcemanager.elasticsan.models.VolumeGroup; +import java.util.Arrays; +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/2022-12-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MaximumSet_Gen. @@ -27,13 +39,34 @@ public static void volumeGroupsUpdateMaximumSetGen(com.azure.resourcemanager.ela .getValue(); resource .update() + .withIdentity( + new Identity() + .withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("key7482", new UserAssignedIdentity()))) .withProtocolType(StorageTargetType.ISCSI) .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) + .withEncryptionProperties( + new EncryptionProperties() + .withKeyVaultProperties( + new KeyVaultProperties() + .withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder")) + .withEncryptionIdentity(new EncryptionIdentity().withEncryptionUserAssignedIdentity("im"))) + .withNetworkAcls( + new NetworkRuleSet() + .withVirtualNetworkRules( + Arrays + .asList( + new VirtualNetworkRule() + .withVirtualNetworkResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}") + .withAction(Action.ALLOW)))) .apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MinimumSet_Gen. @@ -49,4 +82,16 @@ public static void volumeGroupsUpdateMinimumSetGen(com.azure.resourcemanager.ela .getValue(); resource.update().apply(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsCreateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsCreateSamples.java new file mode 100644 index 000000000000..f38f2dfd8cf2 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsCreateSamples.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.generated; + +import com.azure.resourcemanager.elasticsan.models.SnapshotCreationData; + +/** Samples for VolumeSnapshots Create. */ +public final class VolumeSnapshotsCreateSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsCreateMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .define("snapshotname") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withCreationData( + new SnapshotCreationData() + .withSourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}")) + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsCreateMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .define("snapshotname") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withCreationData( + new SnapshotCreationData() + .withSourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}")) + .create(); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsDeleteSamples.java new file mode 100644 index 000000000000..065fa3d13578 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsDeleteSamples.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; + +/** Samples for VolumeSnapshots Delete. */ +public final class VolumeSnapshotsDeleteSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsDeleteMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsDeleteMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsGetSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsGetSamples.java new file mode 100644 index 000000000000..ab331ddee73b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsGetSamples.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.generated; + +/** Samples for VolumeSnapshots Get. */ +public final class VolumeSnapshotsGetSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "snapshotname", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsListByVolumeGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsListByVolumeGroupSamples.java new file mode 100644 index 000000000000..04e56627c748 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeSnapshotsListByVolumeGroupSamples.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.generated; + +/** Samples for VolumeSnapshots ListByVolumeGroup. */ +public final class VolumeSnapshotsListByVolumeGroupSamples { + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsListByVolumeGroupMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .listByVolumeGroup( + "resourcegroupname", "elasticsanname", "volumegroupname", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json + */ + /** + * Sample code: VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void volumeSnapshotsListByVolumeGroupMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .volumeSnapshots() + .listByVolumeGroup( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumeName eq ", + com.azure.core.util.Context.NONE); + } +} 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 index 6a167e8679f0..2ddb504a5b1a 100644 --- 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 @@ -4,13 +4,14 @@ package com.azure.resourcemanager.elasticsan.generated; +import com.azure.resourcemanager.elasticsan.models.ManagedByInfo; import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; /** Samples for Volumes Create. */ public final class VolumesCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MaximumSet_Gen.json */ /** * Sample code: Volumes_Create_MaximumSet_Gen. @@ -22,14 +23,15 @@ public static void volumesCreateMaximumSetGen(com.azure.resourcemanager.elastics .volumes() .define("volumename") .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") - .withSizeGiB(23L) + .withSizeGiB(9L) .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri(" ARM Id of resource")) + new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceId("ARM Id of Resource")) + .withManagedBy(new ManagedByInfo().withResourceId("mtkeip")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MinimumSet_Gen.json */ /** * Sample code: Volumes_Create_MinimumSet_Gen. @@ -41,7 +43,7 @@ public static void volumesCreateMinimumSetGen(com.azure.resourcemanager.elastics .volumes() .define("volumename") .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") - .withSizeGiB(23L) + .withSizeGiB(9L) .create(); } } 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 index 9ab4db6eacd2..10f869ca37b6 100644 --- 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 @@ -4,10 +4,13 @@ package com.azure.resourcemanager.elasticsan.generated; +import com.azure.resourcemanager.elasticsan.models.XMsDeleteSnapshots; +import com.azure.resourcemanager.elasticsan.models.XMsForceDelete; + /** Samples for Volumes Delete. */ public final class VolumesDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MinimumSet_Gen.json */ /** * Sample code: Volumes_Delete_MinimumSet_Gen. @@ -22,11 +25,13 @@ public static void volumesDeleteMinimumSetGen(com.azure.resourcemanager.elastics "elasticsanname", "volumegroupname", "volumename", + null, + null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MaximumSet_Gen.json */ /** * Sample code: Volumes_Delete_MaximumSet_Gen. @@ -41,6 +46,8 @@ public static void volumesDeleteMaximumSetGen(com.azure.resourcemanager.elastics "elasticsanname", "volumegroupname", "volumename", + XMsDeleteSnapshots.TRUE, + XMsForceDelete.TRUE, com.azure.core.util.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 index 254865a24a00..22fc03149a79 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for Volumes Get. */ public final class VolumesGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MaximumSet_Gen.json */ /** * Sample code: Volumes_Get_MaximumSet_Gen. @@ -26,7 +26,7 @@ public static void volumesGetMaximumSetGen(com.azure.resourcemanager.elasticsan. } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MinimumSet_Gen.json */ /** * Sample code: Volumes_Get_MinimumSet_Gen. 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 index 2300a87fa5cb..a3f632a56d4d 100644 --- 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 @@ -7,7 +7,7 @@ /** Samples for Volumes ListByVolumeGroup. */ public final class VolumesListByVolumeGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen. @@ -23,7 +23,7 @@ public static void volumesListByVolumeGroupMaximumSetGen( } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen. 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 index fa82fc3007d4..b04b378f5bb4 100644 --- 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 @@ -9,7 +9,7 @@ /** Samples for Volumes Update. */ public final class VolumesUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MinimumSet_Gen.json */ /** * Sample code: Volumes_Update_MinimumSet_Gen. @@ -31,7 +31,7 @@ public static void volumesUpdateMinimumSetGen(com.azure.resourcemanager.elastics } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MaximumSet_Gen.json */ /** * Sample code: Volumes_Update_MaximumSet_Gen. diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanInnerTests.java deleted file mode 100644 index 433e99acfcc4..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanInnerTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; -import com.azure.resourcemanager.elasticsan.models.Sku; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ElasticSanInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElasticSanInner model = - BinaryData - .fromString( - "{\"properties\":{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"wbxgjvt\",\"vpys\",\"zdn\",\"uj\"],\"provisioningState\":\"Deleting\",\"baseSizeTiB\":6415098811593450314,\"extendedCapacitySizeTiB\":4001606914042880577,\"totalVolumeSizeGiB\":364540657930641108,\"volumeGroupCount\":7961685994099072162,\"totalIops\":2510679492644856616,\"totalMBps\":41329089410242621,\"totalSizeTiB\":4520848990140400139,\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"zxufiz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"fihrfi\",\"actionsRequired\":\"vzwdzuhtymwis\"},\"groupIds\":[\"thwxmnteiwaopvkm\",\"jcmmxdcufufsrp\",\"mzidnsezcxtb\"]},\"id\":\"gfycc\",\"name\":\"newmdwzjeiachbo\",\"type\":\"sflnrosfqp\"},{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"zvypyqrimzinp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"dkirsoodqxhcr\",\"actionsRequired\":\"ohjtckw\"},\"groupIds\":[\"oifiyipjxsqwpgr\",\"bznorcjxvsnby\",\"qabnmoc\",\"cyshurzafbljjgp\"]},\"id\":\"oq\",\"name\":\"jmkljavbqidtqajz\",\"type\":\"ulpkudjkrl\"}]},\"location\":\"bzhfepgzgqexz\",\"tags\":{\"glu\":\"xscpaierhhbc\"},\"id\":\"majtjaod\",\"name\":\"obnbdxkqpxokaj\",\"type\":\"onpimexgstxg\"}") - .toObject(ElasticSanInner.class); - Assertions.assertEquals("bzhfepgzgqexz", model.location()); - Assertions.assertEquals("xscpaierhhbc", model.tags().get("glu")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("wbxgjvt", model.availabilityZones().get(0)); - Assertions.assertEquals(6415098811593450314L, model.baseSizeTiB()); - Assertions.assertEquals(4001606914042880577L, model.extendedCapacitySizeTiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElasticSanInner model = - new ElasticSanInner() - .withLocation("bzhfepgzgqexz") - .withTags(mapOf("glu", "xscpaierhhbc")) - .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withAvailabilityZones(Arrays.asList("wbxgjvt", "vpys", "zdn", "uj")) - .withBaseSizeTiB(6415098811593450314L) - .withExtendedCapacitySizeTiB(4001606914042880577L); - model = BinaryData.fromObject(model).toObject(ElasticSanInner.class); - Assertions.assertEquals("bzhfepgzgqexz", model.location()); - Assertions.assertEquals("xscpaierhhbc", model.tags().get("glu")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("wbxgjvt", model.availabilityZones().get(0)); - Assertions.assertEquals(6415098811593450314L, model.baseSizeTiB()); - Assertions.assertEquals(4001606914042880577L, model.extendedCapacitySizeTiB()); - } - - @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/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanListTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanListTests.java deleted file mode 100644 index 226bdd85c4a6..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanListTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; -import com.azure.resourcemanager.elasticsan.models.ElasticSanList; -import com.azure.resourcemanager.elasticsan.models.Sku; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ElasticSanListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElasticSanList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"sku\":{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"xhocdgeablgphuti\",\"ndv\",\"aozwyiftyhxhu\",\"okftyxolniwpwcuk\"],\"provisioningState\":\"Deleting\",\"baseSizeTiB\":5413928169725328380,\"extendedCapacitySizeTiB\":6655543031987188756,\"totalVolumeSizeGiB\":831725990805220252,\"volumeGroupCount\":3283985932829658956,\"totalIops\":3346461090524524080,\"totalMBps\":5365450808227113003,\"totalSizeTiB\":8979659875393704693,\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"dhsgcba\",\"name\":\"phejkotynqgoulz\",\"type\":\"dlikwyqkgfgibma\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"akeqs\",\"name\":\"xybz\",\"type\":\"qedqytbciqfoufl\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"nkzsmodmglou\",\"name\":\"pbkwtmu\",\"type\":\"duqkt\"}]},\"location\":\"spwgcuertumkdosv\",\"tags\":{\"bjf\":\"bmdg\",\"bexppb\":\"dgmb\",\"rolfpfp\":\"tq\"},\"id\":\"algbquxigjyjg\",\"name\":\"jaoyfhrtx\",\"type\":\"lnerkujysvleju\"}],\"nextLink\":\"qawrlyxwj\"}") - .toObject(ElasticSanList.class); - Assertions.assertEquals("spwgcuertumkdosv", model.value().get(0).location()); - Assertions.assertEquals("bmdg", model.value().get(0).tags().get("bjf")); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("xhocdgeablgphuti", model.value().get(0).availabilityZones().get(0)); - Assertions.assertEquals(5413928169725328380L, model.value().get(0).baseSizeTiB()); - Assertions.assertEquals(6655543031987188756L, model.value().get(0).extendedCapacitySizeTiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElasticSanList model = - new ElasticSanList() - .withValue( - Arrays - .asList( - new ElasticSanInner() - .withLocation("spwgcuertumkdosv") - .withTags(mapOf("bjf", "bmdg", "bexppb", "dgmb", "rolfpfp", "tq")) - .withSku(new Sku().withName(SkuName.PREMIUM_ZRS).withTier(SkuTier.PREMIUM)) - .withAvailabilityZones( - Arrays.asList("xhocdgeablgphuti", "ndv", "aozwyiftyhxhu", "okftyxolniwpwcuk")) - .withBaseSizeTiB(5413928169725328380L) - .withExtendedCapacitySizeTiB(6655543031987188756L))); - model = BinaryData.fromObject(model).toObject(ElasticSanList.class); - Assertions.assertEquals("spwgcuertumkdosv", model.value().get(0).location()); - Assertions.assertEquals("bmdg", model.value().get(0).tags().get("bjf")); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("xhocdgeablgphuti", model.value().get(0).availabilityZones().get(0)); - Assertions.assertEquals(5413928169725328380L, model.value().get(0).baseSizeTiB()); - Assertions.assertEquals(6655543031987188756L, model.value().get(0).extendedCapacitySizeTiB()); - } - - @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/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanPropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanPropertiesTests.java deleted file mode 100644 index 9f4b02c72286..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanPropertiesTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanProperties; -import com.azure.resourcemanager.elasticsan.models.Sku; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ElasticSanPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElasticSanProperties model = - BinaryData - .fromString( - "{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"aajrm\",\"djwzrlov\",\"clwhijcoejctbz\",\"qsqsy\"],\"provisioningState\":\"Failed\",\"baseSizeTiB\":2042468041956868674,\"extendedCapacitySizeTiB\":922454223620020137,\"totalVolumeSizeGiB\":6954441473774697621,\"volumeGroupCount\":7905979691977489381,\"totalIops\":7972922778163490727,\"totalMBps\":3960203806561274270,\"totalSizeTiB\":8067111908299407616,\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Invalid\",\"privateEndpoint\":{\"id\":\"dtocj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"pmouexhdz\",\"actionsRequired\":\"bqe\"},\"groupIds\":[\"xqbzvddntwnd\",\"icbtwnpzao\",\"vuhrhcffcyddgl\"]},\"id\":\"t\",\"name\":\"jqkwpyeicx\",\"type\":\"qciwqvhkhixuigdt\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"joghmewuama\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ayvvtpgvdf\",\"actionsRequired\":\"otkftutqxlngx\"},\"groupIds\":[\"gug\",\"xkrxdqmi\",\"tthzrvqd\",\"abhjybi\"]},\"id\":\"h\",\"name\":\"qfbow\",\"type\":\"kanyktzlcuiywg\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"drvyn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Failed\",\"description\":\"phrcgyncoc\",\"actionsRequired\":\"cfvmmco\"},\"groupIds\":[\"xlzevgbmqjqabcy\",\"mivkwlzuvcc\",\"wnfnbacf\"]},\"id\":\"nlebxetqgtzxd\",\"name\":\"nqbqqwxr\",\"type\":\"feallnwsu\"},{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{\"id\":\"ampmngnz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"qwoochcbon\",\"actionsRequired\":\"pkvlrxn\"},\"groupIds\":[\"seiphe\"]},\"id\":\"lokeyy\",\"name\":\"enjbdlwtgrhp\",\"type\":\"jp\"}]}") - .toObject(ElasticSanProperties.class); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("aajrm", model.availabilityZones().get(0)); - Assertions.assertEquals(2042468041956868674L, model.baseSizeTiB()); - Assertions.assertEquals(922454223620020137L, model.extendedCapacitySizeTiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElasticSanProperties model = - new ElasticSanProperties() - .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withAvailabilityZones(Arrays.asList("aajrm", "djwzrlov", "clwhijcoejctbz", "qsqsy")) - .withBaseSizeTiB(2042468041956868674L) - .withExtendedCapacitySizeTiB(922454223620020137L); - model = BinaryData.fromObject(model).toObject(ElasticSanProperties.class); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("aajrm", model.availabilityZones().get(0)); - Assertions.assertEquals(2042468041956868674L, model.baseSizeTiB()); - Assertions.assertEquals(922454223620020137L, model.extendedCapacitySizeTiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdatePropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdatePropertiesTests.java deleted file mode 100644 index d5d9238ff233..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdatePropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class ElasticSanUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElasticSanUpdateProperties model = - BinaryData - .fromString("{\"baseSizeTiB\":6845758831924711808,\"extendedCapacitySizeTiB\":2937936941611488852}") - .toObject(ElasticSanUpdateProperties.class); - Assertions.assertEquals(6845758831924711808L, model.baseSizeTiB()); - Assertions.assertEquals(2937936941611488852L, model.extendedCapacitySizeTiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElasticSanUpdateProperties model = - new ElasticSanUpdateProperties() - .withBaseSizeTiB(6845758831924711808L) - .withExtendedCapacitySizeTiB(2937936941611488852L); - model = BinaryData.fromObject(model).toObject(ElasticSanUpdateProperties.class); - Assertions.assertEquals(6845758831924711808L, model.baseSizeTiB()); - Assertions.assertEquals(2937936941611488852L, model.extendedCapacitySizeTiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdateTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdateTests.java deleted file mode 100644 index 9f5e6fe66d13..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdateTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ElasticSanUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElasticSanUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"baseSizeTiB\":4267767116121181039,\"extendedCapacitySizeTiB\":5437486908155623563},\"tags\":{\"kqsleyyvxy\":\"zrkgqhcjrefovg\",\"cr\":\"jpkcattpng\",\"ajvnysounqe\":\"czsqpjhvm\",\"oaeupfhyhltrpmo\":\"a\"}}") - .toObject(ElasticSanUpdate.class); - Assertions.assertEquals("zrkgqhcjrefovg", model.tags().get("kqsleyyvxy")); - Assertions.assertEquals(4267767116121181039L, model.baseSizeTiB()); - Assertions.assertEquals(5437486908155623563L, model.extendedCapacitySizeTiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElasticSanUpdate model = - new ElasticSanUpdate() - .withTags( - mapOf( - "kqsleyyvxy", - "zrkgqhcjrefovg", - "cr", - "jpkcattpng", - "ajvnysounqe", - "czsqpjhvm", - "oaeupfhyhltrpmo", - "a")) - .withBaseSizeTiB(4267767116121181039L) - .withExtendedCapacitySizeTiB(5437486908155623563L); - model = BinaryData.fromObject(model).toObject(ElasticSanUpdate.class); - Assertions.assertEquals("zrkgqhcjrefovg", model.tags().get("kqsleyyvxy")); - Assertions.assertEquals(4267767116121181039L, model.baseSizeTiB()); - Assertions.assertEquals(5437486908155623563L, model.extendedCapacitySizeTiB()); - } - - @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/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateMockTests.java deleted file mode 100644 index 52fe84b5144b..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansCreateMockTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.ElasticSan; -import com.azure.resourcemanager.elasticsan.models.Sku; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ElasticSansCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"skfc\",\"tq\",\"miekkezzikhlyfjh\",\"gqggebdunygae\"],\"provisioningState\":\"Succeeded\",\"baseSizeTiB\":8623333094540637378,\"extendedCapacitySizeTiB\":7064706580171927315,\"totalVolumeSizeGiB\":6620237582798297782,\"volumeGroupCount\":2223326609364776386,\"totalIops\":6269428665110751573,\"totalMBps\":3059787385770886832,\"totalSizeTiB\":8763898175289325999,\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Invalid\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"dmjsjqb\",\"hhyxxrw\",\"yc\",\"duhpk\"]},\"id\":\"gymare\",\"name\":\"n\",\"type\":\"jxqugjhky\"},{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"gssofwq\",\"zqalkrmnjijpx\",\"cqqudf\",\"byxbaaabjy\"]},\"id\":\"yffimrzrtuzqogs\",\"name\":\"xnevfdnwn\",\"type\":\"mewzsyyc\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"bjudpfrxtrthzv\"]},\"id\":\"tdwkqbrq\",\"name\":\"bpaxhexiilivpdt\",\"type\":\"irqtdqoa\"}]},\"location\":\"r\",\"tags\":{\"amxjezwlw\":\"gsquyfxrxxlept\",\"ojknio\":\"wxuqlcvydypatdoo\"},\"id\":\"kooebwnu\",\"name\":\"hemms\",\"type\":\"vdkcrodtj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ElasticSan response = - manager - .elasticSans() - .define("uipiccjzk") - .withRegion("mszkkfo") - .withExistingResourceGroup("kallatmel") - .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withBaseSizeTiB(4211102701501758858L) - .withExtendedCapacitySizeTiB(3182031582693006981L) - .withTags(mapOf("jawneaiv", "yfkzik", "elsfeaen", "wczelpci", "dxbjhwuaanozj", "abfatkl")) - .withAvailabilityZones(Arrays.asList("c")) - .create(); - - Assertions.assertEquals("r", response.location()); - Assertions.assertEquals("gsquyfxrxxlept", response.tags().get("amxjezwlw")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("skfc", response.availabilityZones().get(0)); - Assertions.assertEquals(8623333094540637378L, response.baseSizeTiB()); - Assertions.assertEquals(7064706580171927315L, response.extendedCapacitySizeTiB()); - } - - @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/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteMockTests.java deleted file mode 100644 index e16cb4c0bc85..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ElasticSansDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.elasticSans().delete("koymkcd", "h", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupWithResponseMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index f86ca1996d92..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.ElasticSan; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ElasticSansGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"uwsyrsndsytgadg\",\"r\",\"ea\"],\"provisioningState\":\"Invalid\",\"baseSizeTiB\":8790170709983104417,\"extendedCapacitySizeTiB\":2560405099971295143,\"totalVolumeSizeGiB\":5418047259495493586,\"volumeGroupCount\":1125965714665499028,\"totalIops\":6720110805650369040,\"totalMBps\":8598185540275371348,\"totalSizeTiB\":1710903714386145180,\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"bjibwwiftohq\",\"vpuvks\"]},\"id\":\"lsa\",\"name\":\"nynfsynljphuo\",\"type\":\"xodlqiyntorzih\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"w\",\"rmslyzrpzbchckqq\"]},\"id\":\"ioxiysuiizyn\",\"name\":\"edyatrwyhqmibzyh\",\"type\":\"itsmypyyn\"}]},\"location\":\"dpumnzgmw\",\"tags\":{\"rgjhxb\":\"abikns\",\"tncvokot\":\"dtlwwrlkd\",\"gsyocogj\":\"lxdy\",\"kvci\":\"tdtbnnhadooc\"},\"id\":\"hnvpamqgxq\",\"name\":\"u\",\"type\":\"zikywgg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ElasticSan response = - manager - .elasticSans() - .getByResourceGroupWithResponse("pkkpw", "reqnovvqfov", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dpumnzgmw", response.location()); - Assertions.assertEquals("abikns", response.tags().get("rgjhxb")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("uwsyrsndsytgadg", response.availabilityZones().get(0)); - Assertions.assertEquals(8790170709983104417L, response.baseSizeTiB()); - Assertions.assertEquals(2560405099971295143L, response.extendedCapacitySizeTiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupMockTests.java deleted file mode 100644 index df7045db629a..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.ElasticSan; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ElasticSansListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"mnubexkpzksmond\",\"mquxvypo\",\"gkopkwhojvpajqgx\",\"smocmbq\"],\"provisioningState\":\"Failed\",\"baseSizeTiB\":2080717942090846717,\"extendedCapacitySizeTiB\":4393936245762938181,\"totalVolumeSizeGiB\":9205614201426151802,\"volumeGroupCount\":5899001695027882086,\"totalIops\":8877607325390723490,\"totalMBps\":4333811039870085147,\"totalSizeTiB\":3216178139310379008,\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"cuejrjxgci\",\"ibrhosxsdqr\",\"zoymibmrqyibahw\"]},\"id\":\"uszdtmhrkwof\",\"name\":\"yvoqa\",\"type\":\"piexpbtgiw\"}]},\"location\":\"oenwashr\",\"tags\":{\"ulpiuj\":\"kcnqxwbpo\",\"obyu\":\"aasipqi\"},\"id\":\"erpqlpqwcciuqg\",\"name\":\"dbutauvfbtkuwhh\",\"type\":\"hykojoxafnndlpic\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.elasticSans().listByResourceGroup("rfouyftaakcpw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("oenwashr", response.iterator().next().location()); - Assertions.assertEquals("kcnqxwbpo", response.iterator().next().tags().get("ulpiuj")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("mnubexkpzksmond", response.iterator().next().availabilityZones().get(0)); - Assertions.assertEquals(2080717942090846717L, response.iterator().next().baseSizeTiB()); - Assertions.assertEquals(4393936245762938181L, response.iterator().next().extendedCapacitySizeTiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListMockTests.java deleted file mode 100644 index d4a09f565926..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.ElasticSan; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ElasticSansListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"sku\":{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"qqkdltfzxmhhvhgu\",\"eodkwobda\",\"xtibqdxbxwakbog\"],\"provisioningState\":\"Creating\",\"baseSizeTiB\":1899793527406427487,\"extendedCapacitySizeTiB\":389744531539649860,\"totalVolumeSizeGiB\":5105282198099297863,\"volumeGroupCount\":4187834271496207519,\"totalIops\":822687425279743867,\"totalMBps\":5090164062241027652,\"totalSizeTiB\":7759435142378575824,\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"byyntwlrbqt\",\"oievseotgqrlltm\"]},\"id\":\"lauwzizxbmpgcjef\",\"name\":\"zmuvpbttdumorppx\",\"type\":\"bmnzbtbhjpgl\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"neuelfphsdyhtoz\"]},\"id\":\"kd\",\"name\":\"wwquuvxzxclvithh\",\"type\":\"zonosgg\"},{\"properties\":{\"provisioningState\":\"Invalid\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"wdsjnkalju\",\"iiswacffgdkzze\"]},\"id\":\"fvhqc\",\"name\":\"a\",\"type\":\"lvpnpp\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"dmhdlxyjr\",\"sag\",\"fcnihgwq\"]},\"id\":\"nedgfbc\",\"name\":\"kcvqvpke\",\"type\":\"dcvd\"}]},\"location\":\"vo\",\"tags\":{\"vnhdldwmgxcxr\":\"otbobzdopcj\",\"niyqslui\":\"lpmutwuoegrpkhj\"},\"id\":\"pdggkzzlvm\",\"name\":\"mpaxmodfvuefywsb\",\"type\":\"fvmwy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.elasticSans().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vo", response.iterator().next().location()); - Assertions.assertEquals("otbobzdopcj", response.iterator().next().tags().get("vnhdldwmgxcxr")); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("qqkdltfzxmhhvhgu", response.iterator().next().availabilityZones().get(0)); - Assertions.assertEquals(1899793527406427487L, response.iterator().next().baseSizeTiB()); - Assertions.assertEquals(389744531539649860L, response.iterator().next().extendedCapacitySizeTiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/IscsiTargetInfoTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/IscsiTargetInfoTests.java deleted file mode 100644 index e45d40dd9767..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/IscsiTargetInfoTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo; -import com.azure.resourcemanager.elasticsan.models.OperationalStatus; -import org.junit.jupiter.api.Assertions; - -public final class IscsiTargetInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IscsiTargetInfo model = - BinaryData - .fromString( - "{\"targetIqn\":\"pnvjtoqnermclf\",\"targetPortalHostname\":\"phoxus\",\"targetPortalPort\":2041952882,\"provisioningState\":\"Canceled\",\"status\":\"Invalid\"}") - .toObject(IscsiTargetInfo.class); - Assertions.assertEquals(OperationalStatus.INVALID, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IscsiTargetInfo model = new IscsiTargetInfo().withStatus(OperationalStatus.INVALID); - model = BinaryData.fromObject(model).toObject(IscsiTargetInfo.class); - Assertions.assertEquals(OperationalStatus.INVALID, model.status()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/NetworkRuleSetTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/NetworkRuleSetTests.java deleted file mode 100644 index 07e404c7d610..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/NetworkRuleSetTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.Action; -import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; -import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkRuleSetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkRuleSet model = - BinaryData - .fromString( - "{\"virtualNetworkRules\":[{\"id\":\"qpuedckzywbiex\",\"action\":\"Allow\",\"state\":\"failed\"}]}") - .toObject(NetworkRuleSet.class); - Assertions.assertEquals("qpuedckzywbiex", model.virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.virtualNetworkRules().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkRuleSet model = - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("qpuedckzywbiex") - .withAction(Action.ALLOW))); - model = BinaryData.fromObject(model).toObject(NetworkRuleSet.class); - Assertions.assertEquals("qpuedckzywbiex", model.virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationDisplayTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationDisplayTests.java deleted file mode 100644 index b186b67936a4..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationInnerTests.java deleted file mode 100644 index 9644d7aa7235..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; -import com.azure.resourcemanager.elasticsan.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationListResultTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationListResultTests.java deleted file mode 100644 index 7166983e5317..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationsListMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationsListMockTests.java deleted file mode 100644 index ba39ae71eacf..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"qbhsfxobl\",\"isDataAction\":false,\"display\":{\"provider\":\"mpew\",\"resource\":\"fbkrvrnsvs\",\"operation\":\"johxcrsb\",\"description\":\"vasrruvwb\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 2ed6c4bbacec..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"jpqyegu\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"xxhejjzzvd\",\"actionsRequired\":\"gwdslfhotwm\"},\"groupIds\":[\"pwlbjnpg\",\"cftadeh\",\"nltyfsoppusuesnz\"]},\"id\":\"ej\",\"name\":\"avo\",\"type\":\"xzdmohctb\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xxhejjzzvd", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gwdslfhotwm", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("pwlbjnpg", model.groupIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("xxhejjzzvd") - .withActionsRequired("gwdslfhotwm")) - .withGroupIds(Arrays.asList("pwlbjnpg", "cftadeh", "nltyfsoppusuesnz")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("xxhejjzzvd", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("gwdslfhotwm", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("pwlbjnpg", model.groupIds().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionListResultTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index a902537fc220..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{\"id\":\"rjaw\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"xhniskxfbkpycgk\",\"actionsRequired\":\"ndnhj\"},\"groupIds\":[\"whvylw\",\"btdhxujznbm\",\"ow\",\"wpr\"]},\"id\":\"lve\",\"name\":\"alupjm\",\"type\":\"hfxobbcswsrtj\"}],\"nextLink\":\"plrbpbewtghf\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("xhniskxfbkpycgk", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ndnhj", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("whvylw", model.value().get(0).groupIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = - new PrivateEndpointConnectionListResult() - .withValue( - Arrays - .asList( - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("xhniskxfbkpycgk") - .withActionsRequired("ndnhj")) - .withGroupIds(Arrays.asList("whvylw", "btdhxujznbm", "ow", "wpr")))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("xhniskxfbkpycgk", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ndnhj", model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("whvylw", model.value().get(0).groupIds().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 5ba98757f2d2..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"xdn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"w\",\"actionsRequired\":\"jjugwdkcglhslaz\"},\"groupIds\":[\"ggd\",\"jixhbk\",\"ofqweykhmenevfye\"]}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("w", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jjugwdkcglhslaz", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ggd", model.groupIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("w") - .withActionsRequired("jjugwdkcglhslaz")) - .withGroupIds(Arrays.asList("ggd", "jixhbk", "ofqweykhmenevfye")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("w", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("jjugwdkcglhslaz", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("ggd", model.groupIds().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateMockTests.java deleted file mode 100644 index a4d976d06787..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"yeozphvwauyqncy\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"vipmdscwxqupevzh\",\"actionsRequired\":\"totxhojujb\"},\"groupIds\":[\"lmcuvhixb\",\"xyfwnylrcool\",\"ttpkiwkkbnujrywv\",\"y\"]},\"id\":\"fpncurdo\",\"name\":\"wiithtywub\",\"type\":\"cbihwqk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .define("pn") - .withExistingElasticSan("xeznoi", "brnjwmw") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("taugzxnfaa") - .withActionsRequired("xdtnkdmkqjjlw")) - .withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("vrkpyouaibreb")) - .create(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("vipmdscwxqupevzh", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("totxhojujb", response.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("lmcuvhixb", response.groupIds().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index c4204362f605..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .privateEndpointConnections() - .delete("hbpnaixexccbd", "eaxhcexdrrvqahqk", "htpwij", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 92dc95ebb23e..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{\"id\":\"vjayvblmhvkzu\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"vyhgs\",\"actionsRequired\":\"byrqufeg\"},\"groupIds\":[\"wz\"]},\"id\":\"nhlmctlpdng\",\"name\":\"tvgbmhrixkwmy\",\"type\":\"jejveg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .getWithResponse("x", "v", "kkgll", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.PENDING, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("vyhgs", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("byrqufeg", response.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("wz", response.groupIds().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListMockTests.java deleted file mode 100644 index 05993d6cbba6..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{\"id\":\"ppyostronzmyhgf\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"xkmcwaekrrjre\",\"actionsRequired\":\"xt\"},\"groupIds\":[\"mhjglikkxwslolb\"]},\"id\":\"vuzlm\",\"name\":\"felfktg\",\"type\":\"lcrpw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().list("hyjsvfycx", "bfvoowvrv", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - PrivateEndpointServiceConnectionStatus.REJECTED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals( - "xkmcwaekrrjre", response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("xt", response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("mhjglikkxwslolb", response.iterator().next().groupIds().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointTests.java deleted file mode 100644 index fbaf36cb4863..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"whybcib\"}").toObject(PrivateEndpoint.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint(); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceListResultInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceListResultInnerTests.java deleted file mode 100644 index 3287d9df1a1d..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceListResultInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkResource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResultInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"wxzvlvqhjkb\",\"requiredMembers\":[\"btn\",\"xiebwwaloayqcg\",\"rtzju\",\"gwyzm\"],\"requiredZoneNames\":[\"ongmtsa\",\"jcbpwxqpsrknft\",\"uvriuhprwm\",\"yvxqtayriwwroy\"]},\"id\":\"exrmcqibycnojvk\",\"name\":\"mefqsgzvahapjyzh\",\"type\":\"vgqzcjrvxd\"},{\"properties\":{\"groupId\":\"mwlxk\",\"requiredMembers\":[\"fhzovawjvzunluth\",\"n\",\"rnxipei\",\"pjzu\"],\"requiredZoneNames\":[\"xdult\",\"kzbbtd\",\"umveekgpwozuhkf\",\"bsjyofdx\"]},\"id\":\"us\",\"name\":\"ttouwaboekqvkel\",\"type\":\"smv\"},{\"properties\":{\"groupId\":\"yjsflhhcaalnji\",\"requiredMembers\":[\"xyawj\",\"yaqcslyjpkiidz\",\"exznelixhnr\"],\"requiredZoneNames\":[\"o\",\"hb\",\"xknalaulppg\"]},\"id\":\"tpnapnyiropuhpig\",\"name\":\"pgylg\",\"type\":\"git\"}],\"nextLink\":\"edjvcslynqw\"}") - .toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("ongmtsa", model.value().get(0).requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResultInner model = - new PrivateLinkResourceListResultInner() - .withValue( - Arrays - .asList( - new PrivateLinkResource() - .withRequiredZoneNames( - Arrays.asList("ongmtsa", "jcbpwxqpsrknft", "uvriuhprwm", "yvxqtayriwwroy")), - new PrivateLinkResource() - .withRequiredZoneNames(Arrays.asList("xdult", "kzbbtd", "umveekgpwozuhkf", "bsjyofdx")), - new PrivateLinkResource().withRequiredZoneNames(Arrays.asList("o", "hb", "xknalaulppg")))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("ongmtsa", model.value().get(0).requiredZoneNames().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcePropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 065582ec7252..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"yngudivk\",\"requiredMembers\":[\"wbxqzvszjfau\",\"j\"],\"requiredZoneNames\":[\"xivetvt\",\"qaqtdoqmcbxvwvxy\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("xivetvt", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("xivetvt", "qaqtdoqmcbxvwvxy")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("xivetvt", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceTests.java deleted file mode 100644 index 404376235f96..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourceTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkResource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResource model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"wzz\",\"requiredMembers\":[\"ktrmgucnapkt\",\"oellwp\",\"fdygpfqbuaceopz\",\"qrhhu\"],\"requiredZoneNames\":[\"ppcqeqxolz\",\"ahzxctobgbk\",\"moizpos\"]},\"id\":\"grcfb\",\"name\":\"nrmfqjhhk\",\"type\":\"bpvjymjhx\"}") - .toObject(PrivateLinkResource.class); - Assertions.assertEquals("ppcqeqxolz", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResource model = - new PrivateLinkResource().withRequiredZoneNames(Arrays.asList("ppcqeqxolz", "ahzxctobgbk", "moizpos")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals("ppcqeqxolz", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanWithResponseMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanWithResponseMockTests.java deleted file mode 100644 index 7ad5e3a7416d..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkResourceListResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByElasticSanWithResponseMockTests { - @Test - public void testListByElasticSanWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"fdlwg\",\"requiredMembers\":[\"sb\",\"tov\",\"tgseinqfiufxqkn\"],\"requiredZoneNames\":[\"gnepttwqmsni\",\"fcdmqnrojlpijn\",\"rxfrddhc\",\"atiz\"]},\"id\":\"onasxifto\",\"name\":\"qyzhf\",\"type\":\"wesgogczh\"}],\"nextLink\":\"nxkrlgnyhmossxkk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResourceListResult response = - manager - .privateLinkResources() - .listByElasticSanWithResponse("fdntwjchrdgoih", "umwctondz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gnepttwqmsni", response.value().get(0).requiredZoneNames().get(0)); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkServiceConnectionStateTests.java deleted file mode 100644 index 0b8a142d0118..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkServiceConnectionStateTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionState model = - BinaryData - .fromString("{\"status\":\"Failed\",\"description\":\"c\",\"actionsRequired\":\"tynnaamdectehfi\"}") - .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.FAILED, model.status()); - Assertions.assertEquals("c", model.description()); - Assertions.assertEquals("tynnaamdectehfi", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionState model = - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.FAILED) - .withDescription("c") - .withActionsRequired("tynnaamdectehfi"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.FAILED, model.status()); - Assertions.assertEquals("c", model.description()); - Assertions.assertEquals("tynnaamdectehfi", model.actionsRequired()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuCapabilityTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuCapabilityTests.java deleted file mode 100644 index 84576a844336..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuCapabilityTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.SkuCapability; - -public final class SkuCapabilityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuCapability model = - BinaryData.fromString("{\"name\":\"hutje\",\"value\":\"mrldhu\"}").toObject(SkuCapability.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability(); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationInnerTests.java deleted file mode 100644 index a26253c1ed78..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.SkuInformationInner; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuInformationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuInformationInner model = - BinaryData - .fromString( - "{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\",\"resourceType\":\"qjbpfzfsin\",\"locations\":[\"f\"],\"locationInfo\":[{\"location\":\"zoxxjtf\",\"zones\":[\"uwfzitonpe\",\"fpjkjlxofp\",\"vhpfxxypininmay\",\"uybbkpodep\"]},{\"location\":\"ginuvamih\",\"zones\":[\"narxzxtheotus\",\"vyevcciqi\",\"nhungbw\"]},{\"location\":\"rnfygxgispem\",\"zones\":[\"fkufublj\",\"fxqeof\",\"aeqjhqjbasvms\"]},{\"location\":\"qulngsntnbybkzgc\",\"zones\":[\"clxxwrljdo\",\"skcqvkocrcjd\"]}],\"capabilities\":[{\"name\":\"hxbnjbiksqrg\",\"value\":\"sainqpjwnzl\"},{\"name\":\"fmppe\",\"value\":\"vmgxsab\"}]}") - .toObject(SkuInformationInner.class); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuInformationInner model = new SkuInformationInner().withName(SkuName.PREMIUM_ZRS).withTier(SkuTier.PREMIUM); - model = BinaryData.fromObject(model).toObject(SkuInformationInner.class); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationListTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationListTests.java deleted file mode 100644 index f42f638287ec..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.SkuInformationList; - -public final class SkuInformationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuInformationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"Premium_LRS\",\"tier\":\"Premium\",\"resourceType\":\"xqhabi\",\"locations\":[\"kxwczbyscnpqxuhi\",\"y\"],\"locationInfo\":[{\"location\":\"b\",\"zones\":[\"k\",\"vd\"]},{\"location\":\"jgrtfwvukxga\",\"zones\":[\"cs\",\"h\"]},{\"location\":\"cnyejhkryhtnapcz\",\"zones\":[\"kjyemkk\",\"ni\"]},{\"location\":\"oxzjnchgejspod\",\"zones\":[\"lzydehojwyahux\",\"npmqnjaqwixjspro\"]}],\"capabilities\":[{\"name\":\"utegjvwmfdats\",\"value\":\"dvpjhulsuuvmk\"},{\"name\":\"zkrwfn\",\"value\":\"odjpslwejd\"},{\"name\":\"wryoqpsoacc\",\"value\":\"zakljlahbc\"},{\"name\":\"ffdfdosygexpa\",\"value\":\"akhmsbzjhcrz\"}]}],\"nextLink\":\"dphlxaolt\"}") - .toObject(SkuInformationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuInformationList model = new SkuInformationList(); - model = BinaryData.fromObject(model).toObject(SkuInformationList.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuLocationInfoTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuLocationInfoTests.java deleted file mode 100644 index 94a130df60cc..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuLocationInfoTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.SkuLocationInfo; - -public final class SkuLocationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SkuLocationInfo model = - BinaryData - .fromString("{\"location\":\"qduujitcjczdz\",\"zones\":[\"dhkrwpdappdsbdk\",\"wrwjfeu\"]}") - .toObject(SkuLocationInfo.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuLocationInfo model = new SkuLocationInfo(); - model = BinaryData.fromObject(model).toObject(SkuLocationInfo.class); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuTests.java deleted file mode 100644 index b758a3b66805..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.Sku; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import org.junit.jupiter.api.Assertions; - -public final class SkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Sku model = BinaryData.fromString("{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\"}").toObject(Sku.class); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Sku model = new Sku().withName(SkuName.PREMIUM_ZRS).withTier(SkuTier.PREMIUM); - model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkusListMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkusListMockTests.java deleted file mode 100644 index 0bce24d982aa..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkusListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.SkuInformation; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SkusListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\",\"resourceType\":\"fbjfdtwssotftpvj\",\"locations\":[\"xilzznf\",\"q\",\"vwpm\",\"taruoujmkcj\"],\"locationInfo\":[{\"location\":\"tjrybnwjewgdr\",\"zones\":[\"vnaenqpehindoyg\",\"ifthnz\",\"ndslgnayqigynduh\"]},{\"location\":\"hqlkthumaqo\",\"zones\":[\"ycduier\",\"gccymvaolpssl\"]},{\"location\":\"fmmdnbbg\",\"zones\":[\"swiydmcwyhzdx\",\"sadbz\",\"nvdfznuda\"]},{\"location\":\"vxzbncb\",\"zones\":[\"pstdbhhxsrzd\",\"ucerscdntnevfi\",\"jmygtdsslswtmwer\",\"ofz\"]}],\"capabilities\":[{\"name\":\"emwabnet\",\"value\":\"hszhedplvwiwu\"},{\"name\":\"wmbesldnkw\",\"value\":\"pp\"},{\"name\":\"lcxog\",\"value\":\"konzmnsik\"}]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.skus().list("ubcgjbirxb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SkuName.PREMIUM_ZRS, response.iterator().next().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().tier()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SourceCreationDataTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SourceCreationDataTests.java deleted file mode 100644 index 86652e31c698..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SourceCreationDataTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import org.junit.jupiter.api.Assertions; - -public final class SourceCreationDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SourceCreationData model = - BinaryData - .fromString("{\"createSource\":\"None\",\"sourceUri\":\"jbkcnxdhbttkph\"}") - .toObject(SourceCreationData.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.createSource()); - Assertions.assertEquals("jbkcnxdhbttkph", model.sourceUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SourceCreationData model = - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("jbkcnxdhbttkph"); - model = BinaryData.fromObject(model).toObject(SourceCreationData.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.createSource()); - Assertions.assertEquals("jbkcnxdhbttkph", model.sourceUri()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VirtualNetworkRuleTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VirtualNetworkRuleTests.java deleted file mode 100644 index 37fe18506dad..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VirtualNetworkRuleTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.Action; -import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; -import org.junit.jupiter.api.Assertions; - -public final class VirtualNetworkRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VirtualNetworkRule model = - BinaryData - .fromString("{\"id\":\"eaxib\",\"action\":\"Allow\",\"state\":\"provisioning\"}") - .toObject(VirtualNetworkRule.class); - Assertions.assertEquals("eaxib", model.virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VirtualNetworkRule model = - new VirtualNetworkRule().withVirtualNetworkResourceId("eaxib").withAction(Action.ALLOW); - model = BinaryData.fromObject(model).toObject(VirtualNetworkRule.class); - Assertions.assertEquals("eaxib", model.virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupInnerTests.java deleted file mode 100644 index ebe8143c1864..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupInnerTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; -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 org.junit.jupiter.api.Assertions; - -public final class VolumeGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"gidyjrrf\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"v\",\"action\":\"Allow\",\"state\":\"succeeded\"}]},\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"cohslkev\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"zfbuhf\",\"actionsRequired\":\"faxkffeii\"},\"groupIds\":[\"vmezy\",\"shxmzsbbzoggigrx\",\"burvjxxjnspy\",\"ptkoenkoukn\"]},\"id\":\"dwtiukbldngkp\",\"name\":\"cipazyxoegukgjnp\",\"type\":\"ucgygevqz\"},{\"properties\":{\"provisioningState\":\"Invalid\",\"privateEndpoint\":{\"id\":\"rbpizc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"sdpydnfyhxdeoejz\",\"actionsRequired\":\"w\"},\"groupIds\":[\"jttgzf\",\"ishc\",\"khaj\"]},\"id\":\"yeamdphagalpb\",\"name\":\"xw\",\"type\":\"ipwhonowk\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{\"id\":\"nkixzbinj\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"tmryw\",\"actionsRequired\":\"zoqftiyqzrnkcqvy\"},\"groupIds\":[\"hzls\",\"cohoq\",\"nwvlryavwhheunmm\"]},\"id\":\"gyxzk\",\"name\":\"noc\",\"type\":\"koklya\"}]},\"id\":\"conuqszfkbeype\",\"name\":\"rmjmwvvjektc\",\"type\":\"senhwlrs\"}") - .toObject(VolumeGroupInner.class); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions - .assertEquals("gidyjrrf", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeGroupInner model = - new VolumeGroupInner() - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("gidyjrrf") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("v") - .withAction(Action.ALLOW)))); - model = BinaryData.fromObject(model).toObject(VolumeGroupInner.class); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions - .assertEquals("gidyjrrf", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupListTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupListTests.java deleted file mode 100644 index 99b4976d8cf6..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupListTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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.BinaryData; -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.StorageTargetType; -import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; -import com.azure.resourcemanager.elasticsan.models.VolumeGroupList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VolumeGroupListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeGroupList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"sfcpkvxodpuozm\"},{\"id\":\"zydagfuaxbezyiuo\"},{\"id\":\"ktwh\"},{\"id\":\"dxwzywqsmbsurexi\"}]},\"privateEndpointConnections\":[{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"ocfs\",\"name\":\"ksymd\",\"type\":\"ys\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"i\",\"name\":\"uxh\",\"type\":\"yudxorrqnbp\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"zvyifqrvkdvj\",\"name\":\"llr\",\"type\":\"vvdfwatkpnpul\"},{\"properties\":{\"privateLinkServiceConnectionState\":{}},\"id\":\"xbczwtruwiqz\",\"name\":\"qjvsovmyokacs\",\"type\":\"kwlhzdo\"}]},\"id\":\"xjmflbvv\",\"name\":\"chrkcciwwzjuqk\",\"type\":\"rsa\"}],\"nextLink\":\"wkuofoskghsauu\"}") - .toObject(VolumeGroupList.class); - Assertions.assertEquals(StorageTargetType.NONE, model.value().get(0).protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.value().get(0).encryption()); - Assertions - .assertEquals( - "sfcpkvxodpuozm", - model.value().get(0).networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeGroupList model = - new VolumeGroupList() - .withValue( - Arrays - .asList( - new VolumeGroupInner() - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("sfcpkvxodpuozm"), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("zydagfuaxbezyiuo"), - new VirtualNetworkRule().withVirtualNetworkResourceId("ktwh"), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("dxwzywqsmbsurexi")))))); - model = BinaryData.fromObject(model).toObject(VolumeGroupList.class); - Assertions.assertEquals(StorageTargetType.NONE, model.value().get(0).protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.value().get(0).encryption()); - Assertions - .assertEquals( - "sfcpkvxodpuozm", - model.value().get(0).networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupPropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupPropertiesTests.java deleted file mode 100644 index cf02bbf6b685..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupProperties; -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 org.junit.jupiter.api.Assertions; - -public final class VolumeGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeGroupProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Updating\",\"protocolType\":\"Iscsi\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"q\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"lihkaetcktvfc\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"kymuctqhjfbebr\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"fuwutttxf\",\"action\":\"Allow\",\"state\":\"provisioning\"}]},\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{\"id\":\"c\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"fnljky\",\"actionsRequired\":\"j\"},\"groupIds\":[\"j\",\"gidokgjljyoxgvcl\"]},\"id\":\"gsncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{\"id\":\"odebfqkkrbmpu\"},\"privateLinkServiceConnectionState\":{\"status\":\"Failed\",\"description\":\"wflzlfbxzpuzy\",\"actionsRequired\":\"spnqzahmgkb\"},\"groupIds\":[\"y\",\"hibnuqqkpika\",\"rgvtqag\"]},\"id\":\"uynhijg\",\"name\":\"mebf\",\"type\":\"iarbutrcvpna\"},{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{\"id\":\"runmp\"},\"privateLinkServiceConnectionState\":{\"status\":\"Failed\",\"description\":\"bh\",\"actionsRequired\":\"nlankxmyskpb\"},\"groupIds\":[\"btkcxywnytnrsyn\",\"qidybyx\",\"zfcl\",\"aaxdbabphlwrq\"]},\"id\":\"ktsthsucocmny\",\"name\":\"azt\",\"type\":\"bt\"}]}") - .toObject(VolumeGroupProperties.class); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions.assertEquals("q", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeGroupProperties model = - new VolumeGroupProperties() - .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule().withVirtualNetworkResourceId("q").withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("lihkaetcktvfc") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("kymuctqhjfbebr") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("fuwutttxf") - .withAction(Action.ALLOW)))); - model = BinaryData.fromObject(model).toObject(VolumeGroupProperties.class); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions.assertEquals("q", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdatePropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdatePropertiesTests.java deleted file mode 100644 index 4608e9cdb0e2..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdatePropertiesTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupUpdateProperties; -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 org.junit.jupiter.api.Assertions; - -public final class VolumeGroupUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeGroupUpdateProperties model = - BinaryData - .fromString( - "{\"protocolType\":\"Iscsi\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"cuh\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"yqiklbbovplwzb\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"gu\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"fssxqukkfplg\",\"action\":\"Allow\",\"state\":\"failed\"}]}}") - .toObject(VolumeGroupUpdateProperties.class); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions.assertEquals("cuh", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeGroupUpdateProperties model = - new VolumeGroupUpdateProperties() - .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("cuh") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("yqiklbbovplwzb") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("gu") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("fssxqukkfplg") - .withAction(Action.ALLOW)))); - model = BinaryData.fromObject(model).toObject(VolumeGroupUpdateProperties.class); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions.assertEquals("cuh", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdateTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdateTests.java deleted file mode 100644 index bd3106048f83..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdateTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// 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.BinaryData; -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 com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VolumeGroupUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeGroupUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"protocolType\":\"Iscsi\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"yoxa\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"jancu\",\"action\":\"Allow\",\"state\":\"succeeded\"},{\"id\":\"bavxbniwdjswzt\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"nxytxh\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"}]}}}") - .toObject(VolumeGroupUpdate.class); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions.assertEquals("yoxa", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeGroupUpdate model = - new VolumeGroupUpdate() - .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("yoxa") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("jancu") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("bavxbniwdjswzt") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("nxytxh") - .withAction(Action.ALLOW)))); - model = BinaryData.fromObject(model).toObject(VolumeGroupUpdate.class); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions.assertEquals("yoxa", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateMockTests.java deleted file mode 100644 index 6f2961418363..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateMockTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -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 com.azure.resourcemanager.elasticsan.models.VolumeGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumeGroupsCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"jrkvfgbvfvpdbo\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"sjq\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"},{\"id\":\"ibdeibq\",\"action\":\"Allow\",\"state\":\"failed\"},{\"id\":\"hvxndzwmkrefajpj\",\"action\":\"Allow\",\"state\":\"failed\"}]},\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"tjivfxzsjabib\"]},\"id\":\"stawfsdjpvkv\",\"name\":\"bjxbkzbzk\",\"type\":\"vncjabudurgk\"},{\"properties\":{\"provisioningState\":\"Pending\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"hjjklff\",\"mouwqlgzrfzeey\",\"bizikayuhq\",\"bjbsybb\"]},\"id\":\"r\",\"name\":\"t\",\"type\":\"dgmfpgvmpipasl\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"ss\"]},\"id\":\"u\",\"name\":\"wbdsr\",\"type\":\"zpdrhneu\"}]},\"id\":\"wqkdwytisibi\",\"name\":\"cgpik\",\"type\":\"zimejzanlfzx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VolumeGroup response = - manager - .volumeGroups() - .define("r") - .withExistingElasticSan("lolp", "vk") - .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("w") - .withAction(Action.ALLOW)))) - .create(); - - Assertions.assertEquals(StorageTargetType.NONE, response.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, response.encryption()); - Assertions - .assertEquals( - "jrkvfgbvfvpdbo", response.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, response.networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteMockTests.java deleted file mode 100644 index 3ee96e7afc43..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumeGroupsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.volumeGroups().delete("hkh", "zxkhnzbonlwnto", "gokdwbwhks", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetWithResponseMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetWithResponseMockTests.java deleted file mode 100644 index f54447ed96d2..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.Action; -import com.azure.resourcemanager.elasticsan.models.EncryptionType; -import com.azure.resourcemanager.elasticsan.models.StorageTargetType; -import com.azure.resourcemanager.elasticsan.models.VolumeGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumeGroupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Updating\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"erqf\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"nkbykutwpfhp\",\"action\":\"Allow\",\"state\":\"succeeded\"},{\"id\":\"skdsnfdsdoakg\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"kzevdlhewpusds\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"}]},\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"cngqqmoakufgmjz\",\"wr\",\"grtwae\",\"u\"]},\"id\":\"kopbminrf\",\"name\":\"woyuhhziuief\",\"type\":\"zbhd\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"qhoftrmaequiah\",\"icslfaoq\"]},\"id\":\"iyylhalnswhccsp\",\"name\":\"kaivwit\",\"type\":\"scywuggwoluhc\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"ai\",\"sbrgz\",\"wmsweypqwd\",\"ggicccnxqhue\"]},\"id\":\"ktt\",\"name\":\"stvlzywemhzrnc\",\"type\":\"dtclusiypb\"}]},\"id\":\"gytguslfead\",\"name\":\"ygqukyhejh\",\"type\":\"isxgfp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - VolumeGroup response = - manager - .volumeGroups() - .getWithResponse("zcmrvexztvb", "qgsfraoyzkoow", "lmnguxaw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(StorageTargetType.NONE, response.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, response.encryption()); - Assertions.assertEquals("erqf", response.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, response.networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanMockTests.java deleted file mode 100644 index 2d91a1973333..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.Action; -import com.azure.resourcemanager.elasticsan.models.EncryptionType; -import com.azure.resourcemanager.elasticsan.models.StorageTargetType; -import com.azure.resourcemanager.elasticsan.models.VolumeGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumeGroupsListByElasticSanMockTests { - @Test - public void testListByElasticSan() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"lpqblylsyxk\",\"action\":\"Allow\",\"state\":\"failed\"},{\"id\":\"ervtiagxs\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"mpsbzkfzbeyv\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"vinvkj\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"}]},\"privateEndpointConnections\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"ewyhml\",\"paztzpofncck\",\"yfzqwhxxbu\"]},\"id\":\"a\",\"name\":\"zfeqztppri\",\"type\":\"lxorjaltolmncws\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"dbnw\",\"cf\",\"ucqdpfuvglsb\",\"jcanvxbvtvudut\"]},\"id\":\"ormrlxqtvcofudfl\",\"name\":\"kgjubgdknnqvsazn\",\"type\":\"n\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"gsahmkycgrauw\",\"uetae\",\"uruv\"]},\"id\":\"ovsm\",\"name\":\"l\",\"type\":\"wabm\"},{\"properties\":{\"provisioningState\":\"Failed\",\"privateEndpoint\":{},\"privateLinkServiceConnectionState\":{},\"groupIds\":[\"frvtpuqu\",\"mqlgk\"]},\"id\":\"tndoaongbjc\",\"name\":\"tujitcjedft\",\"type\":\"waezkojvd\"}]},\"id\":\"zfoqouicybxar\",\"name\":\"gszufoxciqopid\",\"type\":\"amcio\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.volumeGroups().listByElasticSan("nfwjlfltkacjvefk", "lfoakg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(StorageTargetType.NONE, response.iterator().next().protocolType()); - Assertions - .assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, response.iterator().next().encryption()); - Assertions - .assertEquals( - "lpqblylsyxk", - response.iterator().next().networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions - .assertEquals(Action.ALLOW, response.iterator().next().networkAcls().virtualNetworkRules().get(0).action()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeInnerTests.java deleted file mode 100644 index 03d739dc46af..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; -import com.azure.resourcemanager.elasticsan.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import org.junit.jupiter.api.Assertions; - -public final class VolumeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeInner model = - BinaryData - .fromString( - "{\"properties\":{\"volumeId\":\"jzkdeslpvlopwi\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"pkdwzbai\"},\"sizeGiB\":3085775452141512212,\"storageTarget\":{\"targetIqn\":\"umnyqu\",\"targetPortalHostname\":\"deoj\",\"targetPortalPort\":746279797,\"provisioningState\":\"Creating\",\"status\":\"Updating\"}},\"id\":\"mtxpsiebtfh\",\"name\":\"pesapskrdqmhjj\",\"type\":\"htldwk\"}") - .toObject(VolumeInner.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("pkdwzbai", model.creationData().sourceUri()); - Assertions.assertEquals(3085775452141512212L, model.sizeGiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeInner model = - new VolumeInner() - .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("pkdwzbai")) - .withSizeGiB(3085775452141512212L); - model = BinaryData.fromObject(model).toObject(VolumeInner.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("pkdwzbai", model.creationData().sourceUri()); - Assertions.assertEquals(3085775452141512212L, model.sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeListTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeListTests.java deleted file mode 100644 index fc0890999224..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeListTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; -import com.azure.resourcemanager.elasticsan.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import com.azure.resourcemanager.elasticsan.models.VolumeList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VolumeListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"volumeId\":\"gxywpmue\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"fqkquj\"},\"sizeGiB\":3292485781669976103,\"storageTarget\":{\"targetIqn\":\"onobglaocqx\",\"targetPortalHostname\":\"cmgyud\",\"targetPortalPort\":1613065996,\"provisioningState\":\"Updating\",\"status\":\"Stopped\"}},\"id\":\"rxv\",\"name\":\"fudwpznt\",\"type\":\"hdzhlrqj\"},{\"properties\":{\"volumeId\":\"ck\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"xsbkyvpyca\"},\"sizeGiB\":1835147591912684740,\"storageTarget\":{\"targetIqn\":\"zka\",\"targetPortalHostname\":\"uwbc\",\"targetPortalPort\":946722582,\"provisioningState\":\"Deleting\",\"status\":\"Healthy\"}},\"id\":\"hseyvju\",\"name\":\"rts\",\"type\":\"hspkdeemao\"},{\"properties\":{\"volumeId\":\"xagkvtmelmqkrh\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"uahaquhcdhmd\"},\"sizeGiB\":9171481587703972041,\"storageTarget\":{\"targetIqn\":\"xqpvfadmw\",\"targetPortalHostname\":\"crgvxpvgom\",\"targetPortalPort\":1121960551,\"provisioningState\":\"Deleting\",\"status\":\"Unknown\"}},\"id\":\"wbnb\",\"name\":\"e\",\"type\":\"dawkzbali\"},{\"properties\":{\"volumeId\":\"rqhakauha\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"xosow\"},\"sizeGiB\":4305995232309135618,\"storageTarget\":{\"targetIqn\":\"i\",\"targetPortalHostname\":\"ooxdjebwpuc\",\"targetPortalPort\":1438023413,\"provisioningState\":\"Creating\",\"status\":\"Updating\"}},\"id\":\"vmeueci\",\"name\":\"yhz\",\"type\":\"euojgjrwju\"}],\"nextLink\":\"otwmcdyt\"}") - .toObject(VolumeList.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.value().get(0).creationData().createSource()); - Assertions.assertEquals("fqkquj", model.value().get(0).creationData().sourceUri()); - Assertions.assertEquals(3292485781669976103L, model.value().get(0).sizeGiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeList model = - new VolumeList() - .withValue( - Arrays - .asList( - new VolumeInner() - .withCreationData( - new SourceCreationData() - .withCreateSource(VolumeCreateOption.NONE) - .withSourceUri("fqkquj")) - .withSizeGiB(3292485781669976103L), - new VolumeInner() - .withCreationData( - new SourceCreationData() - .withCreateSource(VolumeCreateOption.NONE) - .withSourceUri("xsbkyvpyca")) - .withSizeGiB(1835147591912684740L), - new VolumeInner() - .withCreationData( - new SourceCreationData() - .withCreateSource(VolumeCreateOption.NONE) - .withSourceUri("uahaquhcdhmd")) - .withSizeGiB(9171481587703972041L), - new VolumeInner() - .withCreationData( - new SourceCreationData() - .withCreateSource(VolumeCreateOption.NONE) - .withSourceUri("xosow")) - .withSizeGiB(4305995232309135618L))); - model = BinaryData.fromObject(model).toObject(VolumeList.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.value().get(0).creationData().createSource()); - Assertions.assertEquals("fqkquj", model.value().get(0).creationData().sourceUri()); - Assertions.assertEquals(3292485781669976103L, model.value().get(0).sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumePropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumePropertiesTests.java deleted file mode 100644 index f5050f662a3b..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumePropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeProperties; -import com.azure.resourcemanager.elasticsan.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import org.junit.jupiter.api.Assertions; - -public final class VolumePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeProperties model = - BinaryData - .fromString( - "{\"volumeId\":\"xuutkncwscwsv\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"g\"},\"sizeGiB\":8759230338879353208,\"storageTarget\":{\"targetIqn\":\"qsx\",\"targetPortalHostname\":\"micykvceoveilo\",\"targetPortalPort\":660644635,\"provisioningState\":\"Creating\",\"status\":\"Unknown\"}}") - .toObject(VolumeProperties.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("g", model.creationData().sourceUri()); - Assertions.assertEquals(8759230338879353208L, model.sizeGiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeProperties model = - new VolumeProperties() - .withCreationData(new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("g")) - .withSizeGiB(8759230338879353208L); - model = BinaryData.fromObject(model).toObject(VolumeProperties.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("g", model.creationData().sourceUri()); - Assertions.assertEquals(8759230338879353208L, model.sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdatePropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdatePropertiesTests.java deleted file mode 100644 index 63788d299e74..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdatePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class VolumeUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeUpdateProperties model = - BinaryData.fromString("{\"sizeGiB\":8481136103419413526}").toObject(VolumeUpdateProperties.class); - Assertions.assertEquals(8481136103419413526L, model.sizeGiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeUpdateProperties model = new VolumeUpdateProperties().withSizeGiB(8481136103419413526L); - model = BinaryData.fromObject(model).toObject(VolumeUpdateProperties.class); - Assertions.assertEquals(8481136103419413526L, model.sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdateTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdateTests.java deleted file mode 100644 index 286e51f3b459..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdateTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// 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.BinaryData; -import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; -import org.junit.jupiter.api.Assertions; - -public final class VolumeUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VolumeUpdate model = - BinaryData.fromString("{\"properties\":{\"sizeGiB\":3301208873451353508}}").toObject(VolumeUpdate.class); - Assertions.assertEquals(3301208873451353508L, model.sizeGiB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VolumeUpdate model = new VolumeUpdate().withSizeGiB(3301208873451353508L); - model = BinaryData.fromObject(model).toObject(VolumeUpdate.class); - Assertions.assertEquals(3301208873451353508L, model.sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateMockTests.java deleted file mode 100644 index 09afb0c369ad..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.Volume; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumesCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"volumeId\":\"i\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"atmtdhtmdvy\"},\"sizeGiB\":7303334041566766737,\"storageTarget\":{\"targetIqn\":\"gszywk\",\"targetPortalHostname\":\"rryuzhlhkjo\",\"targetPortalPort\":1145336567,\"provisioningState\":\"Pending\",\"status\":\"Stopped" - + " (deallocated)\"}},\"id\":\"t\",\"name\":\"inrvgoupmfi\",\"type\":\"bfggjioolvr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Volume response = - manager - .volumes() - .define("apfcqdpsq") - .withExistingVolumegroup("hwyg", "lvdnkfx", "semdwzrmu") - .withSizeGiB(2764555725436180174L) - .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("ypql")) - .create(); - - Assertions.assertEquals(VolumeCreateOption.NONE, response.creationData().createSource()); - Assertions.assertEquals("atmtdhtmdvy", response.creationData().sourceUri()); - Assertions.assertEquals(7303334041566766737L, response.sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteMockTests.java deleted file mode 100644 index 68748a1c4f44..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.volumes().delete("av", "mbzonokix", "jq", "irgzp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetWithResponseMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetWithResponseMockTests.java deleted file mode 100644 index 4888c8fdb3d2..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.Volume; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"volumeId\":\"sj\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"fjvfbgofeljagr\"},\"sizeGiB\":550277468451673444,\"storageTarget\":{\"targetIqn\":\"dvriiiojnal\",\"targetPortalHostname\":\"fk\",\"targetPortalPort\":762010823,\"provisioningState\":\"Invalid\",\"status\":\"Stopped\"}},\"id\":\"owueluqh\",\"name\":\"ahhxvrh\",\"type\":\"zkw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Volume response = - manager - .volumes() - .getWithResponse("rlazszrnw", "iin", "fpwpjylwbt", "h", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(VolumeCreateOption.NONE, response.creationData().createSource()); - Assertions.assertEquals("fjvfbgofeljagr", response.creationData().sourceUri()); - Assertions.assertEquals(550277468451673444L, response.sizeGiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupMockTests.java deleted file mode 100644 index 8f094e021de2..000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// 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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.Volume; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class VolumesListByVolumeGroupMockTests { - @Test - public void testListByVolumeGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"volumeId\":\"yqtfihwh\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"ngamvpphosz\"},\"sizeGiB\":5042367561387448154,\"storageTarget\":{\"targetIqn\":\"hqamvdkf\",\"targetPortalHostname\":\"nwcvtbvkayhmtnv\",\"targetPortalPort\":440993445,\"provisioningState\":\"Creating\",\"status\":\"Stopped\"}},\"id\":\"wp\",\"name\":\"npwzcjaes\",\"type\":\"vvsccyajguq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ElasticSanManager manager = - ElasticSanManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .volumes() - .listByVolumeGroup("jgwwspughftq", "xhqxujxukndxdigr", "guufzd", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(VolumeCreateOption.NONE, response.iterator().next().creationData().createSource()); - Assertions.assertEquals("ngamvpphosz", response.iterator().next().creationData().sourceUri()); - Assertions.assertEquals(5042367561387448154L, response.iterator().next().sizeGiB()); - } -}