diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/CHANGELOG.md index 239619be481a8..a1dfa10ccdc20 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.2 (Unreleased) +## 1.0.0-beta.1 (2023-07-07) + +- 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). ### Features Added diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/README.md index 8b25c14b4fc77..32f28d522d297 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-2021-11-20-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +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). ## 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.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md b/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md index 5b13cb69ed834..f4dd59be62bda 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/SAMPLE.md @@ -14,6 +14,17 @@ - [List](#operations_list) +## PrivateEndpointConnections + +- [Create](#privateendpointconnections_create) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## PrivateLinkResources + +- [ListByElasticSan](#privatelinkresources_listbyelasticsan) + ## Skus - [List](#skus_list) @@ -46,7 +57,7 @@ import java.util.Map; /** Samples for ElasticSans Create. */ public final class ElasticSansCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MaximumSet_Gen. @@ -56,19 +67,19 @@ public final class ElasticSansCreateSamples { public static void elasticSansCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .elasticSans() - .define("ti7q-k952-1qB3J_5") - .withRegion("aaaaaaaaaaaaaaaaaaaaaaaaaaa") - .withExistingResourceGroup("rgelasticsan") + .define("elasticsanname") + .withRegion("South Central US") + .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withBaseSizeTiB(26L) - .withExtendedCapacitySizeTiB(7L) - .withTags(mapOf("key896", "aaaaaaaaaaaaaaaaaa")) - .withAvailabilityZones(Arrays.asList("aaaaaaaaaaaaaaaaa")) + .withBaseSizeTiB(5L) + .withExtendedCapacitySizeTiB(25L) + .withTags(mapOf("key9316", "ihndtieqibtob")) + .withAvailabilityZones(Arrays.asList("1")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MinimumSet_Gen. @@ -78,12 +89,12 @@ public final class ElasticSansCreateSamples { public static void elasticSansCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .elasticSans() - .define("ti7q-k952-1qB3J_5") - .withRegion((String) null) - .withExistingResourceGroup("rgelasticsan") + .define("elasticsanname") + .withRegion("South Central US") + .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) - .withBaseSizeTiB(26L) - .withExtendedCapacitySizeTiB(7L) + .withBaseSizeTiB(5L) + .withExtendedCapacitySizeTiB(25L) .create(); } @@ -103,12 +114,10 @@ public final class ElasticSansCreateSamples { ### ElasticSans_Delete ```java -import com.azure.core.util.Context; - /** Samples for ElasticSans Delete. */ public final class ElasticSansDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MinimumSet_Gen. @@ -116,11 +125,11 @@ public final class ElasticSansDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void elasticSansDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().delete("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager.elasticSans().delete("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MaximumSet_Gen. @@ -128,7 +137,7 @@ public final class ElasticSansDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void elasticSansDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().delete("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager.elasticSans().delete("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } } ``` @@ -136,12 +145,10 @@ public final class ElasticSansDeleteSamples { ### ElasticSans_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ElasticSans GetByResourceGroup. */ public final class ElasticSansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MinimumSet_Gen. @@ -149,11 +156,13 @@ public final class ElasticSansGetByResourceGroupSamples { * @param manager Entry point to ElasticSanManager. */ public static void elasticSansGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .elasticSans() + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MaximumSet_Gen. @@ -161,7 +170,9 @@ public final class ElasticSansGetByResourceGroupSamples { * @param manager Entry point to ElasticSanManager. */ public static void elasticSansGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .elasticSans() + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } } ``` @@ -169,12 +180,10 @@ public final class ElasticSansGetByResourceGroupSamples { ### ElasticSans_List ```java -import com.azure.core.util.Context; - /** Samples for ElasticSans List. */ public final class ElasticSansListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen. @@ -183,11 +192,11 @@ public final class ElasticSansListSamples { */ public static void elasticSansListBySubscriptionMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().list(Context.NONE); + manager.elasticSans().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MinimumSet_Gen. @@ -196,7 +205,7 @@ public final class ElasticSansListSamples { */ public static void elasticSansListBySubscriptionMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().list(Context.NONE); + manager.elasticSans().list(com.azure.core.util.Context.NONE); } } ``` @@ -204,12 +213,10 @@ public final class ElasticSansListSamples { ### ElasticSans_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ElasticSans ListByResourceGroup. */ public final class ElasticSansListByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MinimumSet_Gen. @@ -218,11 +225,11 @@ public final class ElasticSansListByResourceGroupSamples { */ public static void elasticSansListByResourceGroupMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().listByResourceGroup("rgelasticsan", Context.NONE); + manager.elasticSans().listByResourceGroup("resourcegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen. @@ -231,7 +238,7 @@ public final class ElasticSansListByResourceGroupSamples { */ public static void elasticSansListByResourceGroupMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().listByResourceGroup("rgelasticsan", Context.NONE); + manager.elasticSans().listByResourceGroup("resourcegroupname", com.azure.core.util.Context.NONE); } } ``` @@ -239,7 +246,6 @@ public final class ElasticSansListByResourceGroupSamples { ### ElasticSans_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.models.ElasticSan; import java.util.HashMap; import java.util.Map; @@ -247,7 +253,7 @@ import java.util.Map; /** Samples for ElasticSans Update. */ public final class ElasticSansUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MinimumSet_Gen. @@ -258,13 +264,13 @@ public final class ElasticSansUpdateSamples { ElasticSan resource = manager .elasticSans() - .getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE) + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE) .getValue(); resource.update().apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MaximumSet_Gen. @@ -275,9 +281,9 @@ public final class ElasticSansUpdateSamples { ElasticSan resource = manager .elasticSans() - .getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE) + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("key3137", "aaaaaaaaaaaaaaa")).apply(); + resource.update().withTags(mapOf("key4212", "cqvcnwfefljntgeio")).apply(); } @SuppressWarnings("unchecked") @@ -296,12 +302,10 @@ public final class ElasticSansUpdateSamples { ### Operations_List ```java -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -309,11 +313,11 @@ public final class OperationsListSamples { * @param manager Entry point to ElasticSanManager. */ public static void operationsListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. @@ -321,20 +325,240 @@ public final class OperationsListSamples { * @param manager Entry point to ElasticSanManager. */ public static void operationsListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### Skus_List +### PrivateEndpointConnections_Create + +```java +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; + +/** 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 + */ + /** + * Sample code: PrivateEndpointConnections_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsCreateMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .define("privateendpointconnectionname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("Auto-Approved") + .withActionsRequired("None")) + .withPrivateEndpoint(new PrivateEndpoint()) + .withGroupIds(Arrays.asList("sytxzqlcoapcaywthgwvwcw")) + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsCreateMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .define("privateendpointconnectionname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("Auto-Approved") + .withActionsRequired("None")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +/** 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 + */ + /** + * Sample code: PrivateEndpointConnections_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsDeleteMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsDeleteMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +/** 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 + */ + /** + * Sample code: PrivateEndpointConnections_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsGetMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsGetMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +/** 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 + */ + /** + * Sample code: PrivateEndpointConnections_List_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsListMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .list("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_List_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsListMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .list("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateLinkResources_ListByElasticSan ```java -import com.azure.core.util.Context; +/** 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 + */ + /** + * Sample code: PrivateLinkResources_ListByElasticSan_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateLinkResourcesListByElasticSanMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateLinkResources() + .listByElasticSanWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateLinkResources_ListByElasticSan_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateLinkResourcesListByElasticSanMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateLinkResources() + .listByElasticSanWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } +} +``` +### Skus_List + +```java /** Samples for Skus List. */ public final class SkusListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MinimumSet_Gen.json */ /** * Sample code: Skus_List_MinimumSet_Gen. @@ -342,11 +566,11 @@ public final class SkusListSamples { * @param manager Entry point to ElasticSanManager. */ public static void skusListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.skus().list(null, Context.NONE); + manager.skus().list(null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MaximumSet_Gen.json */ /** * Sample code: Skus_List_MaximumSet_Gen. @@ -354,7 +578,7 @@ public final class SkusListSamples { * @param manager Entry point to ElasticSanManager. */ public static void skusListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.skus().list("aaaa", Context.NONE); + manager.skus().list("dtycml", com.azure.core.util.Context.NONE); } } ``` @@ -368,13 +592,11 @@ import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; /** Samples for VolumeGroups Create. */ public final class VolumeGroupsCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MinimumSet_Gen. @@ -384,13 +606,13 @@ public final class VolumeGroupsCreateSamples { public static void volumeGroupsCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumeGroups() - .define("u_5I_1j4t3") - .withExistingElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5") + .define("volumegroupname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MaximumSet_Gen. @@ -400,9 +622,8 @@ public final class VolumeGroupsCreateSamples { public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumeGroups() - .define("u_5I_1j4t3") - .withExistingElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5") - .withTags(mapOf("key5933", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .define("volumegroupname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") .withProtocolType(StorageTargetType.ISCSI) .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) .withNetworkAcls( @@ -411,33 +632,21 @@ public final class VolumeGroupsCreateSamples { Arrays .asList( new VirtualNetworkRule() - .withVirtualNetworkResourceId("aaaaaaaaaaaaaaaa") + .withVirtualNetworkResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}") .withAction(Action.ALLOW)))) .create(); } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } ``` ### VolumeGroups_Delete ```java -import com.azure.core.util.Context; - /** Samples for VolumeGroups Delete. */ public final class VolumeGroupsDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MinimumSet_Gen. @@ -445,11 +654,13 @@ public final class VolumeGroupsDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .delete("resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MaximumSet_Gen. @@ -457,7 +668,9 @@ public final class VolumeGroupsDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .delete("resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } } ``` @@ -465,12 +678,10 @@ public final class VolumeGroupsDeleteSamples { ### VolumeGroups_Get ```java -import com.azure.core.util.Context; - /** Samples for VolumeGroups Get. */ public final class VolumeGroupsGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MinimumSet_Gen. @@ -478,11 +689,14 @@ public final class VolumeGroupsGetSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MaximumSet_Gen. @@ -490,7 +704,10 @@ public final class VolumeGroupsGetSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } } ``` @@ -498,12 +715,10 @@ public final class VolumeGroupsGetSamples { ### VolumeGroups_ListByElasticSan ```java -import com.azure.core.util.Context; - /** Samples for VolumeGroups ListByElasticSan. */ public final class VolumeGroupsListByElasticSanSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen. @@ -512,11 +727,13 @@ public final class VolumeGroupsListByElasticSanSamples { */ public static void volumeGroupsListByElasticSanMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().listByElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .volumeGroups() + .listByElasticSan("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen. @@ -525,7 +742,9 @@ public final class VolumeGroupsListByElasticSanSamples { */ public static void volumeGroupsListByElasticSanMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().listByElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .volumeGroups() + .listByElasticSan("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } } ``` @@ -533,17 +752,14 @@ public final class VolumeGroupsListByElasticSanSamples { ### VolumeGroups_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.models.EncryptionType; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; import com.azure.resourcemanager.elasticsan.models.VolumeGroup; -import java.util.HashMap; -import java.util.Map; /** Samples for VolumeGroups Update. */ public final class VolumeGroupsUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MaximumSet_Gen. @@ -554,18 +770,18 @@ public final class VolumeGroupsUpdateSamples { VolumeGroup resource = manager .volumeGroups() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE) + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE) .getValue(); resource .update() - .withTags(mapOf("key7542", "aaaaaaaaaaaaaaaaaaaa")) .withProtocolType(StorageTargetType.ISCSI) .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) .apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MinimumSet_Gen. @@ -576,21 +792,11 @@ public final class VolumeGroupsUpdateSamples { VolumeGroup resource = manager .volumeGroups() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE) + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE) .getValue(); resource.update().apply(); } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } ``` @@ -599,13 +805,11 @@ public final class VolumeGroupsUpdateSamples { ```java import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import java.util.HashMap; -import java.util.Map; /** Samples for Volumes Create. */ public final class VolumesCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MaximumSet_Gen.json */ /** * Sample code: Volumes_Create_MaximumSet_Gen. @@ -615,17 +819,16 @@ public final class VolumesCreateSamples { public static void volumesCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumes() - .define("9132y") - .withExistingVolumegroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3") - .withTags(mapOf("key7423", "aaaa")) + .define("volumename") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withSizeGiB(23L) .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("aaaaaa")) - .withSizeGiB(22L) + new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri(" ARM Id of resource")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MinimumSet_Gen.json */ /** * Sample code: Volumes_Create_MinimumSet_Gen. @@ -635,33 +838,21 @@ public final class VolumesCreateSamples { public static void volumesCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumes() - .define("9132y") - .withExistingVolumegroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3") + .define("volumename") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withSizeGiB(23L) .create(); } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } ``` ### Volumes_Delete ```java -import com.azure.core.util.Context; - /** Samples for Volumes Delete. */ public final class VolumesDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json */ /** * Sample code: Volumes_Delete_MinimumSet_Gen. @@ -669,11 +860,18 @@ public final class VolumesDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumesDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json */ /** * Sample code: Volumes_Delete_MaximumSet_Gen. @@ -681,7 +879,14 @@ public final class VolumesDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumesDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } } ``` @@ -689,12 +894,10 @@ public final class VolumesDeleteSamples { ### Volumes_Get ```java -import com.azure.core.util.Context; - /** Samples for Volumes Get. */ public final class VolumesGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json */ /** * Sample code: Volumes_Get_MaximumSet_Gen. @@ -702,11 +905,18 @@ public final class VolumesGetSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumesGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json */ /** * Sample code: Volumes_Get_MinimumSet_Gen. @@ -714,7 +924,14 @@ public final class VolumesGetSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumesGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } } ``` @@ -722,12 +939,10 @@ public final class VolumesGetSamples { ### Volumes_ListByVolumeGroup ```java -import com.azure.core.util.Context; - /** Samples for Volumes ListByVolumeGroup. */ public final class VolumesListByVolumeGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen. @@ -736,11 +951,14 @@ public final class VolumesListByVolumeGroupSamples { */ public static void volumesListByVolumeGroupMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().listByVolumeGroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumes() + .listByVolumeGroup( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen. @@ -749,7 +967,10 @@ public final class VolumesListByVolumeGroupSamples { */ public static void volumesListByVolumeGroupMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().listByVolumeGroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumes() + .listByVolumeGroup( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } } ``` @@ -757,15 +978,12 @@ public final class VolumesListByVolumeGroupSamples { ### Volumes_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.models.Volume; -import java.util.HashMap; -import java.util.Map; /** Samples for Volumes Update. */ public final class VolumesUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MinimumSet_Gen.json */ /** * Sample code: Volumes_Update_MinimumSet_Gen. @@ -776,13 +994,18 @@ public final class VolumesUpdateSamples { Volume resource = manager .volumes() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE) + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE) .getValue(); resource.update().apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MaximumSet_Gen.json */ /** * Sample code: Volumes_Update_MaximumSet_Gen. @@ -793,20 +1016,14 @@ public final class VolumesUpdateSamples { Volume resource = manager .volumes() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE) + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("key1864", "aaaaaaaaa")).withSizeGiB(9L).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + resource.update().withSizeGiB(11L).apply(); } } ``` diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml index df4ab4c275b22..eaa139aefa611 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,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-2021-11-20-preview. + 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. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 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 2ee3ef1775c46..1d4a79e0243c0 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 @@ -27,11 +27,15 @@ import com.azure.resourcemanager.elasticsan.implementation.ElasticSanManagementBuilder; import com.azure.resourcemanager.elasticsan.implementation.ElasticSansImpl; import com.azure.resourcemanager.elasticsan.implementation.OperationsImpl; +import com.azure.resourcemanager.elasticsan.implementation.PrivateEndpointConnectionsImpl; +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.VolumesImpl; import com.azure.resourcemanager.elasticsan.models.ElasticSans; import com.azure.resourcemanager.elasticsan.models.Operations; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnections; +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.Volumes; @@ -54,6 +58,10 @@ public final class ElasticSanManager { private Volumes volumes; + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkResources privateLinkResources; + private final ElasticSanManagement clientObject; private ElasticSanManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -336,6 +344,31 @@ public Volumes volumes() { return volumes; } + /** + * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. + * + * @return Resource collection API of PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + /** * @return Wrapped service client ElasticSanManagement providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. 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 2d251f2bd9129..b8010b7a9503b 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 @@ -78,4 +78,18 @@ public interface ElasticSanManagement { * @return the VolumesClient object. */ VolumesClient getVolumes(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java index d58c5fd9796fe..372d75d5d1cce 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java @@ -8,7 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; +import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { @@ -20,7 +20,7 @@ public interface OperationsClient { * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** * Gets a list of ElasticSan operations. @@ -32,5 +32,5 @@ public interface OperationsClient { * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/PrivateEndpointConnectionsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..4c921926fce0b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters); + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown 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 privateEndpointConnectionName, Context context); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateEndpointConnectionName, Context context); + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String elasticSanName); + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String elasticSanName, Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/PrivateLinkResourcesClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..a647d2d353c00 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listByElasticSanWithResponse( + String resourceGroupName, String elasticSanName, Context context); + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceListResultInner listByElasticSan(String resourceGroupName, String elasticSanName); +} 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 b5441fb78e4cc..3a5f17724b160 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 @@ -24,7 +24,7 @@ public final class ElasticSanInner extends Resource { private ElasticSanProperties innerProperties = new ElasticSanProperties(); /* - * Resource metadata required by ARM RPC + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -43,7 +43,7 @@ private ElasticSanProperties innerProperties() { } /** - * Get the systemData property: Resource metadata required by ARM RPC. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -211,6 +211,15 @@ public Long totalSizeTiB() { return this.innerProperties() == null ? null : this.innerProperties().totalSizeTiB(); } + /** + * Get the privateEndpointConnections property: The list of Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + /** * 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 3de3726d5d7c5..b1eb94cf20c4b 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 @@ -74,6 +74,12 @@ public final class ElasticSanProperties { @JsonProperty(value = "totalSizeTiB", access = JsonProperty.Access.WRITE_ONLY) private Long totalSizeTiB; + /* + * The list of Private Endpoint Connections. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /** Creates an instance of ElasticSanProperties class. */ public ElasticSanProperties() { } @@ -212,6 +218,15 @@ public Long totalSizeTiB() { return this.totalSizeTiB; } + /** + * Get the privateEndpointConnections property: The list of Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * @@ -225,6 +240,9 @@ public void validate() { } else { sku().validate(); } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } private static final ClientLogger LOGGER = new ClientLogger(ElasticSanProperties.class); diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java deleted file mode 100644 index 6c35b7a966c09..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Description of a ElasticSan RP Operation. */ -@Fluent -public final class ElasticSanRPOperationInner { - /* - * The name of the operation being performed on this particular object - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Indicates whether the operation applies to data-plane. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /* - * Additional metadata about RP operation. - */ - @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) - private ElasticSanOperationDisplay display; - - /** Creates an instance of ElasticSanRPOperationInner class. */ - public ElasticSanRPOperationInner() { - } - - /** - * Get the name property: The name of the operation being performed on this particular object. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the operation being performed on this particular object. - * - * @param name the name value to set. - * @return the ElasticSanRPOperationInner object itself. - */ - public ElasticSanRPOperationInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Additional metadata about RP operation. - * - * @return the display value. - */ - public ElasticSanOperationDisplay display() { - return this.display; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ElasticSanRPOperationInner")); - } - if (display() != null) { - display().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ElasticSanRPOperationInner.class); -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/OperationInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..7267d72080c78 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.ActionType; +import com.azure.resourcemanager.elasticsan.models.OperationDisplay; +import com.azure.resourcemanager.elasticsan.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateEndpointConnectionInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..54553043d1bbe --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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.PrivateEndpoint; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for PrivateEndpoint Connection object. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Private Endpoint Connection Properties. + */ + @JsonProperty(value = "properties", required = true) + private PrivateEndpointConnectionProperties innerProperties = new PrivateEndpointConnectionProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + + /** + * Get the innerProperties property: Private Endpoint Connection Properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties 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 provisioningState property: Provisioning State of Private Endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the privateEndpoint property: Private Endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: Private Endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Private Link Service Connection State. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: Private Link Service Connection State. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the groupIds property: List of resources private endpoint is mapped. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Set the groupIds property: List of resources private endpoint is mapped. + * + * @param groupIds the groupIds value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withGroupIds(List groupIds) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withGroupIds(groupIds); + return this; + } + + /** + * 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 PrivateEndpointConnectionInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionInner.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..84e7815ae752c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Response for PrivateEndpoint connection properties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * Provisioning State of Private Endpoint connection resource + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningStates provisioningState; + + /* + * Private Endpoint resource + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Private Link Service Connection State. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * List of resources private endpoint is mapped + */ + @JsonProperty(value = "groupIds") + private List groupIds; + + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + + /** + * Get the provisioningState property: Provisioning State of Private Endpoint connection resource. + * + * @return the provisioningState value. + */ + public ProvisioningStates provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpoint property: Private Endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Private Endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Private Link Service Connection State. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Private Link Service Connection State. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the groupIds property: List of resources private endpoint is mapped. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Set the groupIds property: List of resources private endpoint is mapped. + * + * @param groupIds the groupIds value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withGroupIds(List groupIds) { + this.groupIds = groupIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateLinkResourceListResultInner.java new file mode 100644 index 0000000000000..205a3d912d737 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateLinkResourceListResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResultInner { + /* + * Array of private link resources + */ + @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 PrivateLinkResourceListResultInner class. */ + public PrivateLinkResourceListResultInner() { + } + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResultInner object itself. + */ + public PrivateLinkResourceListResultInner 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/fluent/models/PrivateLinkResourceProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..648a7ece79b29 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** Creates an instance of PrivateLinkResourceProperties class. */ + public PrivateLinkResourceProperties() { + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java index 1a6216157b1ef..7e96c62d9916f 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 @@ -11,9 +11,8 @@ import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; +import java.util.List; /** Response for Volume Group request. */ @Fluent @@ -25,18 +24,11 @@ public final class VolumeGroupInner extends ProxyResource { private VolumeGroupProperties innerProperties; /* - * Resource metadata required by ARM RPC + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * Azure resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - /** Creates an instance of VolumeGroupInner class. */ public VolumeGroupInner() { } @@ -51,7 +43,7 @@ private VolumeGroupProperties innerProperties() { } /** - * Get the systemData property: Resource metadata required by ARM RPC. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -59,26 +51,6 @@ public SystemData systemData() { return this.systemData; } - /** - * Get the tags property: Azure resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Azure resource tags. - * - * @param tags the tags value to set. - * @return the VolumeGroupInner object itself. - */ - public VolumeGroupInner withTags(Map tags) { - this.tags = tags; - return this; - } - /** * Get the provisioningState property: State of the operation on the resource. * @@ -157,6 +129,15 @@ public VolumeGroupInner withNetworkAcls(NetworkRuleSet networkAcls) { return this; } + /** + * Get the privateEndpointConnections property: The list of Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + /** * Validates the instance. * 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 bdc39d865a99e..36be8777650c9 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 @@ -10,6 +10,7 @@ import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** VolumeGroup response properties. */ @Fluent @@ -38,6 +39,12 @@ public final class VolumeGroupProperties { @JsonProperty(value = "networkAcls") private NetworkRuleSet networkAcls; + /* + * The list of Private Endpoint Connections. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /** Creates an instance of VolumeGroupProperties class. */ public VolumeGroupProperties() { } @@ -111,6 +118,15 @@ public VolumeGroupProperties withNetworkAcls(NetworkRuleSet networkAcls) { return this; } + /** + * Get the privateEndpointConnections property: The list of Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * @@ -120,5 +136,8 @@ public void validate() { if (networkAcls() != null) { networkAcls().validate(); } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.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 8dc75e25414bb..436a736906a6a 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 @@ -7,11 +7,10 @@ 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.SourceCreationData; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; /** Response for Volume request. */ @Fluent @@ -19,22 +18,15 @@ public final class VolumeInner extends ProxyResource { /* * Properties of Volume. */ - @JsonProperty(value = "properties") - private VolumeProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private VolumeProperties innerProperties = new VolumeProperties(); /* - * Resource metadata required by ARM RPC + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /* - * Azure resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - /** Creates an instance of VolumeInner class. */ public VolumeInner() { } @@ -49,7 +41,7 @@ private VolumeProperties innerProperties() { } /** - * Get the systemData property: Resource metadata required by ARM RPC. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -57,26 +49,6 @@ public SystemData systemData() { return this.systemData; } - /** - * Get the tags property: Azure resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Azure resource tags. - * - * @param tags the tags value to set. - * @return the VolumeInner object itself. - */ - public VolumeInner withTags(Map tags) { - this.tags = tags; - return this; - } - /** * Get the volumeId property: Unique Id of the volume in GUID format. * @@ -114,8 +86,8 @@ public VolumeInner withCreationData(SourceCreationData creationData) { * * @return the sizeGiB value. */ - public Long sizeGiB() { - return this.innerProperties() == null ? null : this.innerProperties().sizeGiB(); + public long sizeGiB() { + return this.innerProperties() == null ? 0L : this.innerProperties().sizeGiB(); } /** @@ -124,7 +96,7 @@ public Long sizeGiB() { * @param sizeGiB the sizeGiB value to set. * @return the VolumeInner object itself. */ - public VolumeInner withSizeGiB(Long sizeGiB) { + public VolumeInner withSizeGiB(long sizeGiB) { if (this.innerProperties() == null) { this.innerProperties = new VolumeProperties(); } @@ -147,8 +119,14 @@ public IscsiTargetInfo storageTarget() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property innerProperties in model VolumeInner")); + } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(VolumeInner.class); } 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 8e21e6267facb..0dbabf2eebe0d 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 @@ -27,8 +27,8 @@ public final class VolumeProperties { /* * Volume size. */ - @JsonProperty(value = "sizeGiB") - private Long sizeGiB; + @JsonProperty(value = "sizeGiB", required = true) + private long sizeGiB; /* * Storage target information @@ -74,7 +74,7 @@ public VolumeProperties withCreationData(SourceCreationData creationData) { * * @return the sizeGiB value. */ - public Long sizeGiB() { + public long sizeGiB() { return this.sizeGiB; } @@ -84,7 +84,7 @@ public Long sizeGiB() { * @param sizeGiB the sizeGiB value to set. * @return the VolumeProperties object itself. */ - public VolumeProperties withSizeGiB(Long sizeGiB) { + public VolumeProperties withSizeGiB(long sizeGiB) { this.sizeGiB = sizeGiB; return this; } 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 1a5be336923d2..c90cbea8350e6 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 @@ -8,13 +8,16 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.elasticsan.models.ElasticSan; 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.Sku; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class ElasticSanImpl implements ElasticSan, ElasticSan.Definition, ElasticSan.Update { private ElasticSanInner innerObject; @@ -95,6 +98,20 @@ public Long totalSizeTiB() { return this.innerModel().totalSizeTiB(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } 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 b17e3e3b58705..971d737d3a639 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 @@ -25,6 +25,8 @@ import com.azure.resourcemanager.elasticsan.fluent.ElasticSanManagement; import com.azure.resourcemanager.elasticsan.fluent.ElasticSansClient; import com.azure.resourcemanager.elasticsan.fluent.OperationsClient; +import com.azure.resourcemanager.elasticsan.fluent.PrivateEndpointConnectionsClient; +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.VolumesClient; @@ -172,6 +174,30 @@ public VolumesClient getVolumes() { return this.volumes; } + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + /** * Initializes an instance of ElasticSanManagement client. * @@ -194,12 +220,14 @@ public VolumesClient getVolumes() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-11-20-preview"; + this.apiVersion = "2022-12-01-preview"; this.operations = new OperationsClientImpl(this); this.skus = new SkusClientImpl(this); this.elasticSans = new ElasticSansClientImpl(this); this.volumeGroups = new VolumeGroupsClientImpl(this); this.volumes = new VolumesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); } /** diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java deleted file mode 100644 index f356292f67b28..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java +++ /dev/null @@ -1,41 +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.implementation; - -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; -import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationDisplay; -import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation; - -public final class ElasticSanRPOperationImpl implements ElasticSanRPOperation { - private ElasticSanRPOperationInner innerObject; - - private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; - - ElasticSanRPOperationImpl( - ElasticSanRPOperationInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public ElasticSanOperationDisplay display() { - return this.innerModel().display(); - } - - public ElasticSanRPOperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java index 02b2e71175c44..17d73123079cd 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java @@ -65,7 +65,7 @@ public final class ElasticSansClientImpl implements ElasticSansClient { */ @Host("{$host}") @ServiceInterface(name = "ElasticSanManagement") - private interface ElasticSansService { + public interface ElasticSansService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans") @ExpectedResponses({200}) @@ -79,8 +79,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -93,9 +92,8 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}") - @ExpectedResponses({200, 202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @HostParam("$host") String endpoint, @@ -109,8 +107,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -125,8 +122,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -140,8 +136,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -653,7 +648,7 @@ private PollerFlux, ElasticSanInner> beginCreateAsyn @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ElasticSanInner> beginCreate( String resourceGroupName, String elasticSanName, ElasticSanInner parameters) { - return beginCreateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller(); } /** @@ -671,7 +666,7 @@ public SyncPoller, ElasticSanInner> beginCreate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ElasticSanInner> beginCreate( String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) { - return beginCreateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller(); } /** @@ -918,7 +913,7 @@ private PollerFlux, ElasticSanInner> beginUpdateAsyn @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ElasticSanInner> beginUpdate( String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) { - return beginUpdateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller(); } /** @@ -936,7 +931,7 @@ public SyncPoller, ElasticSanInner> beginUpdate( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ElasticSanInner> beginUpdate( String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller(); } /** @@ -1157,7 +1152,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String elasticSanName) { - return beginDeleteAsync(resourceGroupName, elasticSanName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, elasticSanName).getSyncPoller(); } /** @@ -1174,7 +1169,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String elasticSanName, Context context) { - return beginDeleteAsync(resourceGroupName, elasticSanName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, elasticSanName, context).getSyncPoller(); } /** diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationImpl.java new file mode 100644 index 0000000000000..e3ce260f9a46b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; +import com.azure.resourcemanager.elasticsan.models.ActionType; +import com.azure.resourcemanager.elasticsan.models.Operation; +import com.azure.resourcemanager.elasticsan.models.OperationDisplay; +import com.azure.resourcemanager.elasticsan.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java index 116f9e542908e..7a955f46f96b8 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java @@ -25,8 +25,8 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.elasticsan.fluent.OperationsClient; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; -import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationListResult; +import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; +import com.azure.resourcemanager.elasticsan.models.OperationListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -54,12 +54,12 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ElasticSanManagement") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.ElasticSan/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -75,7 +75,7 @@ Mono> list( * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -86,7 +86,7 @@ private Mono> listSinglePageAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( + .>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) @@ -104,7 +104,7 @@ private Mono> listSinglePageAsync() { * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -129,7 +129,7 @@ private Mono> listSinglePageAsync(Cont * @return a list of ElasticSan operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { + private PagedFlux listAsync() { return new PagedFlux<>(() -> listSinglePageAsync()); } @@ -143,7 +143,7 @@ private PagedFlux listAsync() { * @return a list of ElasticSan operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>(() -> listSinglePageAsync(context)); } @@ -155,7 +155,7 @@ private PagedFlux listAsync(Context context) { * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { + public PagedIterable list() { return new PagedIterable<>(listAsync()); } @@ -169,7 +169,7 @@ public PagedIterable list() { * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { + public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java index 65ef49da713b0..968122db7012d 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.elasticsan.fluent.OperationsClient; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; -import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation; +import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; +import com.azure.resourcemanager.elasticsan.models.Operation; import com.azure.resourcemanager.elasticsan.models.Operations; public final class OperationsImpl implements Operations { @@ -25,14 +25,14 @@ public OperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ElasticSanRPOperationImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ElasticSanRPOperationImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..742b6e663da6e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpoint; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner 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 ProvisioningStates provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String elasticSanName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingElasticSan(String resourceGroupName, String elasticSanName) { + this.resourceGroupName = resourceGroupName; + this.elasticSanName = elasticSanName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create( + resourceGroupName, elasticSanName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create(resourceGroupName, elasticSanName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, elasticSanName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, elasticSanName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withGroupIds(List groupIds) { + this.innerModel().withGroupIds(groupIds); + return this; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..d2d5b1f29f1fc --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1067 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnectionListResult; +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 PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(ElasticSanManagementImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + public interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}") + @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("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}") + @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("privateEndpointConnectionName") String privateEndpointConnectionName, + @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}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + parameters, + accept, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return this + .beginCreateAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return this + .beginCreateAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters, context) + .getSyncPoller(); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return beginCreateAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return beginCreateAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters) { + return createAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters).block(); + } + + /** + * Update the state of specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param parameters Private Endpoint Connection Approval 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 PrivateEndpoint Connection object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String elasticSanName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner parameters, + Context context) { + return createAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, parameters, context) + .block(); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName, 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, context).block(); + } + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, elasticSanName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 privateEndpointConnectionName, 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 (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName 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, + privateEndpointConnectionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 privateEndpointConnectionName) { + return this.beginDeleteAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 privateEndpointConnectionName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateEndpointConnectionName) { + deleteAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName).block(); + } + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, elasticSanName, privateEndpointConnectionName, context).block(); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String elasticSanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String elasticSanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String elasticSanName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, elasticSanName)); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String elasticSanName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, elasticSanName, context)); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String elasticSanName) { + return new PagedIterable<>(listAsync(resourceGroupName, elasticSanName)); + } + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String elasticSanName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, elasticSanName, context)); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionsImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..bcfc8e168cbd4 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,210 @@ +// 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.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, elasticSanName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection get( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, elasticSanName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String elasticSanName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, elasticSanName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, elasticSanName, privateEndpointConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String elasticSanName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, elasticSanName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String elasticSanName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, elasticSanName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, elasticSanName, privateEndpointConnectionName, 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, elasticSanName, privateEndpointConnectionName, 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, elasticSanName, privateEndpointConnectionName, 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 privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, elasticSanName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourceListResultImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourceListResultImpl.java new file mode 100644 index 0000000000000..7bd18a681ddb7 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourceListResultImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkResource; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkResourceListResult; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { + private PrivateLinkResourceListResultInner innerObject; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + PrivateLinkResourceListResultImpl( + PrivateLinkResourceListResultInner innerObject, + com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public PrivateLinkResourceListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourcesClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..a4baf80293fde --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.elasticsan.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final ElasticSanManagementImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(ElasticSanManagementImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ElasticSanManagementPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ElasticSanManagement") + public interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByElasticSan( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("elasticSanName") String elasticSanName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByElasticSanWithResponseAsync( + String resourceGroupName, String elasticSanName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByElasticSan( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByElasticSanWithResponseAsync( + String resourceGroupName, String elasticSanName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (elasticSanName == null) { + return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByElasticSan( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + elasticSanName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listByElasticSanAsync( + String resourceGroupName, String elasticSanName) { + return listByElasticSanWithResponseAsync(resourceGroupName, elasticSanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listByElasticSanWithResponse( + String resourceGroupName, String elasticSanName, Context context) { + return listByElasticSanWithResponseAsync(resourceGroupName, elasticSanName, context).block(); + } + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceListResultInner listByElasticSan(String resourceGroupName, String elasticSanName) { + return listByElasticSanWithResponse(resourceGroupName, elasticSanName, Context.NONE).getValue(); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourcesImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..d37945e3aa034 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/PrivateLinkResourcesImpl.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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.elasticsan.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.elasticsan.models.PrivateLinkResources; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager; + + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listByElasticSanWithResponse( + String resourceGroupName, String elasticSanName, Context context) { + Response inner = + this.serviceClient().listByElasticSanWithResponse(resourceGroupName, elasticSanName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateLinkResourceListResult listByElasticSan(String resourceGroupName, String elasticSanName) { + PrivateLinkResourceListResultInner inner = + this.serviceClient().listByElasticSan(resourceGroupName, elasticSanName); + if (inner != null) { + return new PrivateLinkResourceListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java index 7c43bdd05f384..e3d5ed67778de 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java @@ -54,7 +54,7 @@ public final class SkusClientImpl implements SkusClient { */ @Host("{$host}") @ServiceInterface(name = "ElasticSanManagement") - private interface SkusService { + public interface SkusService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus") @ExpectedResponses({200}) 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 fa3e91d5106fc..6071e1e8a19a2 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 @@ -6,15 +6,18 @@ import com.azure.core.management.SystemData; 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.EncryptionType; import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; +import com.azure.resourcemanager.elasticsan.models.PrivateEndpointConnection; import com.azure.resourcemanager.elasticsan.models.ProvisioningStates; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; import com.azure.resourcemanager.elasticsan.models.VolumeGroup; import com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate; import java.util.Collections; -import java.util.Map; +import java.util.List; +import java.util.stream.Collectors; public final class VolumeGroupImpl implements VolumeGroup, VolumeGroup.Definition, VolumeGroup.Update { private VolumeGroupInner innerObject; @@ -37,15 +40,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public ProvisioningStates provisioningState() { return this.innerModel().provisioningState(); } @@ -62,6 +56,20 @@ public NetworkRuleSet networkAcls() { return this.innerModel().networkAcls(); } + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + public String resourceGroupName() { return resourceGroupName; } @@ -164,16 +172,6 @@ public VolumeGroup refresh(Context context) { return this; } - public VolumeGroupImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateParameters.withTags(tags); - return this; - } - } - public VolumeGroupImpl withProtocolType(StorageTargetType protocolType) { if (isInCreateMode()) { this.innerModel().withProtocolType(protocolType); diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java index 17e694a1a3977..86578dfdf9b76 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/VolumeGroupsClientImpl.java @@ -65,11 +65,10 @@ public final class VolumeGroupsClientImpl implements VolumeGroupsClient { */ @Host("{$host}") @ServiceInterface(name = "ElasticSanManagement") - private interface VolumeGroupsService { + public interface VolumeGroupsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumeGroups") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumeGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByElasticSan( @@ -83,9 +82,8 @@ Mono> listByElasticSan( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") - @ExpectedResponses({200, 202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @HostParam("$host") String endpoint, @@ -100,8 +98,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -117,8 +114,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -133,8 +129,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -533,7 +528,7 @@ private PollerFlux, VolumeGroupInner> beginCreateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VolumeGroupInner> beginCreate( String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters) { - return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).getSyncPoller(); + return this.beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).getSyncPoller(); } /** @@ -556,7 +551,8 @@ public SyncPoller, VolumeGroupInner> beginCreate( String volumeGroupName, VolumeGroupInner parameters, Context context) { - return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) + return this + .beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) .getSyncPoller(); } @@ -841,7 +837,7 @@ private PollerFlux, VolumeGroupInner> beginUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, VolumeGroupInner> beginUpdate( String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters) { - return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters).getSyncPoller(); } /** @@ -864,7 +860,8 @@ public SyncPoller, VolumeGroupInner> beginUpdate( String volumeGroupName, VolumeGroupUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) + return this + .beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, parameters, context) .getSyncPoller(); } @@ -1119,7 +1116,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String elasticSanName, String volumeGroupName) { - return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName).getSyncPoller(); } /** @@ -1137,7 +1134,7 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String elasticSanName, String volumeGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, context).getSyncPoller(); } /** 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 8c34dd03191ce..a0d18a047f242 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 @@ -11,8 +11,6 @@ import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.azure.resourcemanager.elasticsan.models.Volume; import com.azure.resourcemanager.elasticsan.models.VolumeUpdate; -import java.util.Collections; -import java.util.Map; public final class VolumeImpl implements Volume, Volume.Definition, Volume.Update { private VolumeInner innerObject; @@ -35,15 +33,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public String volumeId() { return this.innerModel().volumeId(); } @@ -52,7 +41,7 @@ public SourceCreationData creationData() { return this.innerModel().creationData(); } - public Long sizeGiB() { + public long sizeGiB() { return this.innerModel().sizeGiB(); } @@ -166,14 +155,9 @@ public Volume refresh(Context context) { return this; } - public VolumeImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateParameters.withTags(tags); - return this; - } + public VolumeImpl withSizeGiB(long sizeGiB) { + this.innerModel().withSizeGiB(sizeGiB); + return this; } public VolumeImpl withCreationData(SourceCreationData creationData) { @@ -182,16 +166,7 @@ public VolumeImpl withCreationData(SourceCreationData creationData) { } public VolumeImpl withSizeGiB(Long sizeGiB) { - if (isInCreateMode()) { - this.innerModel().withSizeGiB(sizeGiB); - return this; - } else { - this.updateParameters.withSizeGiB(sizeGiB); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; + this.updateParameters.withSizeGiB(sizeGiB); + return this; } } 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 e3306e7912ce4..bd9812183c95f 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 @@ -64,12 +64,11 @@ public final class VolumesClientImpl implements VolumesClient { */ @Host("{$host}") @ServiceInterface(name = "ElasticSanManagement") - private interface VolumesService { + public interface VolumesService { @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") - @ExpectedResponses({200, 202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> create( @HostParam("$host") String endpoint, @@ -85,8 +84,7 @@ Mono>> create( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -103,8 +101,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @@ -120,8 +117,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -137,8 +133,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan" - + "/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByVolumeGroup( @@ -381,7 +376,8 @@ public SyncPoller, VolumeInner> beginCreate( String volumeGroupName, String volumeName, VolumeInner parameters) { - return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) + return this + .beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) .getSyncPoller(); } @@ -407,7 +403,8 @@ public SyncPoller, VolumeInner> beginCreate( String volumeName, VolumeInner parameters, Context context) { - return beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) + return this + .beginCreateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) .getSyncPoller(); } @@ -730,7 +727,8 @@ public SyncPoller, VolumeInner> beginUpdate( String volumeGroupName, String volumeName, VolumeUpdate parameters) { - return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) + return this + .beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters) .getSyncPoller(); } @@ -756,7 +754,8 @@ public SyncPoller, VolumeInner> beginUpdate( String volumeName, VolumeUpdate parameters, Context context) { - return beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) + return this + .beginUpdateAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, parameters, context) .getSyncPoller(); } @@ -1038,7 +1037,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName) { - return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName).getSyncPoller(); } /** @@ -1057,7 +1056,8 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context) { - return beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) + return this + .beginDeleteAsync(resourceGroupName, elasticSanName, volumeGroupName, volumeName, context) .getSyncPoller(); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ActionType.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ActionType.java new file mode 100644 index 0000000000000..8f82224358e31 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/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 ee571f88f7be5..947bbecdc8950 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 @@ -49,7 +49,7 @@ public interface ElasticSan { Map tags(); /** - * Gets the systemData property: Resource metadata required by ARM RPC. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -125,6 +125,13 @@ public interface ElasticSan { */ Long totalSizeTiB(); + /** + * Gets the privateEndpointConnections property: The list of Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * Gets the region of the resource. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java index aee497c690c85..8cfb1f31e6ec8 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanList.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.elasticsan.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,7 +15,7 @@ public final class ElasticSanList { /* * An array of Elastic San objects. */ - @JsonProperty(value = "value", required = true) + @JsonProperty(value = "value") private List value; /* @@ -64,14 +63,8 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ElasticSanList")); - } else { + if (value() != null) { value().forEach(e -> e.validate()); } } - - private static final ClientLogger LOGGER = new ClientLogger(ElasticSanList.class); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java deleted file mode 100644 index 80bcaea87443f..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationDisplay.java +++ /dev/null @@ -1,157 +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.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Metadata about an operation. */ -@Fluent -public final class ElasticSanOperationDisplay { - /* - * Localized friendly form of the resource provider name. - */ - @JsonProperty(value = "provider", required = true) - private String provider; - - /* - * Localized friendly form of the resource type related to this action/operation. - */ - @JsonProperty(value = "resource", required = true) - private String resource; - - /* - * Localized friendly name for the operation, as it should be shown to the user. - */ - @JsonProperty(value = "operation", required = true) - private String operation; - - /* - * Localized friendly description for the operation, as it should be shown to the user. - */ - @JsonProperty(value = "description", required = true) - private String description; - - /** Creates an instance of ElasticSanOperationDisplay class. */ - public ElasticSanOperationDisplay() { - } - - /** - * Get the provider property: Localized friendly form of the resource provider name. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Set the provider property: Localized friendly form of the resource provider name. - * - * @param provider the provider value to set. - * @return the ElasticSanOperationDisplay object itself. - */ - public ElasticSanOperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Localized friendly form of the resource type related to this action/operation. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: Localized friendly form of the resource type related to this action/operation. - * - * @param resource the resource value to set. - * @return the ElasticSanOperationDisplay object itself. - */ - public ElasticSanOperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Localized friendly name for the operation, as it should be shown to the user. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: Localized friendly name for the operation, as it should be shown to the user. - * - * @param operation the operation value to set. - * @return the ElasticSanOperationDisplay object itself. - */ - public ElasticSanOperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Localized friendly description for the operation, as it should be shown to the - * user. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Localized friendly description for the operation, as it should be shown to the - * user. - * - * @param description the description value to set. - * @return the ElasticSanOperationDisplay object itself. - */ - public ElasticSanOperationDisplay withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (provider() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property provider in model ElasticSanOperationDisplay")); - } - if (resource() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property resource in model ElasticSanOperationDisplay")); - } - if (operation() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property operation in model ElasticSanOperationDisplay")); - } - if (description() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property description in model ElasticSanOperationDisplay")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ElasticSanOperationDisplay.class); -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.java deleted file mode 100644 index 556bc35890e68..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanOperationListResult.java +++ /dev/null @@ -1,89 +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.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of operations supported by the RP. */ -@Fluent -public final class ElasticSanOperationListResult { - /* - * An array of operations supported by the ElasticSan RP. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * URI to fetch the next section of the paginated response. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of ElasticSanOperationListResult class. */ - public ElasticSanOperationListResult() { - } - - /** - * Get the value property: An array of operations supported by the ElasticSan RP. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of operations supported by the ElasticSan RP. - * - * @param value the value value to set. - * @return the ElasticSanOperationListResult object itself. - */ - public ElasticSanOperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URI to fetch the next section of the paginated response. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URI to fetch the next section of the paginated response. - * - * @param nextLink the nextLink value to set. - * @return the ElasticSanOperationListResult object itself. - */ - public ElasticSanOperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model ElasticSanOperationListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ElasticSanOperationListResult.class); -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.java deleted file mode 100644 index c86413f2707fd..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ElasticSanRPOperation.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.models; - -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner; - -/** An immutable client-side representation of ElasticSanRPOperation. */ -public interface ElasticSanRPOperation { - /** - * Gets the name property: The name of the operation being performed on this particular object. - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Indicates whether the operation applies to data-plane. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Additional metadata about RP operation. - * - * @return the display value. - */ - ElasticSanOperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner object. - * - * @return the inner object. - */ - ElasticSanRPOperationInner innerModel(); -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionType.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/EncryptionType.java index 0e486a19bbd1b..d5c9323890a13 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,15 @@ public final class EncryptionType extends ExpandableStringEnum { public static final EncryptionType ENCRYPTION_AT_REST_WITH_PLATFORM_KEY = fromString("EncryptionAtRestWithPlatformKey"); + /** + * Creates a new instance of EncryptionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EncryptionType() { + } + /** * Creates or finds a EncryptionType from its string representation. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operation.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operation.java new file mode 100644 index 0000000000000..8215d80e003bc --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Operation.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationDisplay.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationDisplay.java new file mode 100644 index 0000000000000..ecf9d9a34ed1c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationListResult.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationListResult.java new file mode 100644 index 0000000000000..d689fd4759a18 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.elasticsan.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java index 1776e34955f51..0d04b2df84d93 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/OperationalStatus.java @@ -34,6 +34,15 @@ public final class OperationalStatus extends ExpandableStringEnum list(); + PagedIterable list(); /** * Gets a list of ElasticSan operations. @@ -27,5 +27,5 @@ public interface Operations { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Origin.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Origin.java new file mode 100644 index 0000000000000..35d4056d96267 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/Origin.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpoint.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..4494fe7dafe77 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for PrivateEndpoint. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for Private Endpoint + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + + /** + * Get the id property: The ARM identifier for Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnection.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..2a088cbe30536 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnection.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * 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 provisioningState property: Provisioning State of Private Endpoint connection resource. + * + * @return the provisioningState value. + */ + ProvisioningStates provisioningState(); + + /** + * Gets the privateEndpoint property: Private Endpoint resource. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Private Link Service Connection State. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the groupIds property: List of resources private endpoint is mapped. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithPrivateLinkServiceConnectionState, + DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, elasticSanName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @return the next definition stage. + */ + WithPrivateLinkServiceConnectionState withExistingElasticSan( + String resourceGroupName, String elasticSanName); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: Private Link Service Connection State.. + * + * @param privateLinkServiceConnectionState Private Link Service Connection State. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + /** + * The stage of the PrivateEndpointConnection 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.WithPrivateEndpoint, DefinitionStages.WithGroupIds { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: Private Endpoint resource. + * + * @param privateEndpoint Private Endpoint resource. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify groupIds. */ + interface WithGroupIds { + /** + * Specifies the groupIds property: List of resources private endpoint is mapped. + * + * @param groupIds List of resources private endpoint is mapped. + * @return the next definition stage. + */ + WithCreate withGroupIds(List groupIds); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnectionListResult.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..0d14bc9c30a8b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnectionListResult.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.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connections associated with SAN. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * Array of private endpoint connections + */ + @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 PrivateEndpointConnectionListResult class. */ + public PrivateEndpointConnectionListResult() { + } + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult 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/PrivateEndpointConnections.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..54f4c907e980b --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointConnections.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.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 PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName, Context context); + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San. + */ + PrivateEndpointConnection get( + String resourceGroupName, String elasticSanName, String privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateEndpointConnectionName); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param privateEndpointConnectionName The name of the Private Endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 privateEndpointConnectionName, Context context); + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String elasticSanName); + + /** + * List all Private Endpoint Connections associated with the Elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of private endpoint connections associated with SAN as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String elasticSanName, Context context); + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets the specified private endpoint connection associated with the Elastic San. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified private endpoint connection associated with the Elastic San along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified private endpoint connection associated with the Elastic San. + * + * @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 PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointServiceConnectionStatus.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..c57e93ade411c --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateEndpointServiceConnectionStatus.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The private endpoint connection status. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Failed for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus FAILED = fromString("Failed"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates a new instance of PrivateEndpointServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateEndpointServiceConnectionStatus() { + } + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** + * Gets known PrivateEndpointServiceConnectionStatus values. + * + * @return known PrivateEndpointServiceConnectionStatus values. + */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResource.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..812829ba9a81e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResource.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResource extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of PrivateLinkResource class. */ + public PrivateLinkResource() { + } + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties 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 groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResource object itself. + */ + public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResourceListResult.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..4c16da609baf2 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResourceListResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResourceListResult. */ +public interface PrivateLinkResourceListResult { + /** + * Gets the value property: Array of private link resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URI to fetch the next section of the paginated response. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.elasticsan.fluent.models.PrivateLinkResourceListResultInner object. + * + * @return the inner object. + */ + PrivateLinkResourceListResultInner innerModel(); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResources.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..c3a2d73f40aef --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkResources.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San along with {@link Response}. + */ + Response listByElasticSanWithResponse( + String resourceGroupName, String elasticSanName, Context context); + + /** + * Gets the private link resources that need to be created for a elastic San. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param elasticSanName The name of the ElasticSan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private link resources that need to be created for a elastic San. + */ + PrivateLinkResourceListResult listByElasticSan(String resourceGroupName, String elasticSanName); +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkServiceConnectionState.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..25dcebd756ae4 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Response for Private Link Service Connection state. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + 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/ProvisioningStates.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.java index 8f4639cbe433d..78136091fd9b8 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/ProvisioningStates.java @@ -34,6 +34,15 @@ public final class ProvisioningStates extends ExpandableStringEnum 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 SkuInformationList class. */ public SkuInformationList() { } @@ -31,6 +37,15 @@ public List value() { return this.value; } + /** + * 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. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuName.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuName.java index 72de9109037b3..c457285906b72 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuName.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuName.java @@ -16,6 +16,15 @@ public final class SkuName extends ExpandableStringEnum { /** Static value Premium_ZRS for SkuName. */ public static final SkuName PREMIUM_ZRS = fromString("Premium_ZRS"); + /** + * Creates a new instance of SkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuName() { + } + /** * Creates or finds a SkuName from its string representation. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuTier.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuTier.java index bf5a0b5d04702..282bc42cb5c36 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuTier.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/SkuTier.java @@ -13,6 +13,15 @@ public final class SkuTier extends ExpandableStringEnum { /** Static value Premium for SkuTier. */ public static final SkuTier PREMIUM = fromString("Premium"); + /** + * Creates a new instance of SkuTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuTier() { + } + /** * Creates or finds a SkuTier from its string representation. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java index 9e526c0e5c33c..bb9b49d9a094e 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/StorageTargetType.java @@ -16,6 +16,15 @@ public final class StorageTargetType extends ExpandableStringEnum tags(); - /** * Gets the volumeId property: Unique Id of the volume in GUID format. * @@ -65,7 +57,7 @@ public interface Volume { * * @return the sizeGiB value. */ - Long sizeGiB(); + long sizeGiB(); /** * Gets the storageTarget property: Storage target information. @@ -90,7 +82,10 @@ public interface Volume { /** The entirety of the Volume definition. */ interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithSizeGiB, + DefinitionStages.WithCreate { } /** The Volume definition stages. */ interface DefinitionStages { @@ -107,14 +102,24 @@ interface WithParentResource { * @param volumeGroupName The name of the VolumeGroup. * @return the next definition stage. */ - WithCreate withExistingVolumegroup(String resourceGroupName, String elasticSanName, String volumeGroupName); + WithSizeGiB withExistingVolumegroup( + String resourceGroupName, String elasticSanName, String volumeGroupName); + } + /** The stage of the Volume definition allowing to specify sizeGiB. */ + interface WithSizeGiB { + /** + * Specifies the sizeGiB property: Volume size.. + * + * @param sizeGiB Volume size. + * @return the next definition stage. + */ + WithCreate withSizeGiB(long sizeGiB); } /** * The stage of the Volume definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithCreationData, DefinitionStages.WithSizeGiB { + interface WithCreate extends DefinitionStages.WithCreationData { /** * Executes the create request. * @@ -130,16 +135,6 @@ interface WithCreate */ Volume create(Context context); } - /** The stage of the Volume definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Azure resource tags.. - * - * @param tags Azure resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } /** The stage of the Volume definition allowing to specify creationData. */ interface WithCreationData { /** @@ -150,16 +145,6 @@ interface WithCreationData { */ WithCreate withCreationData(SourceCreationData creationData); } - /** The stage of the Volume definition allowing to specify sizeGiB. */ - interface WithSizeGiB { - /** - * Specifies the sizeGiB property: Volume size.. - * - * @param sizeGiB Volume size. - * @return the next definition stage. - */ - WithCreate withSizeGiB(Long sizeGiB); - } } /** * Begins update for the Volume resource. @@ -169,7 +154,7 @@ interface WithSizeGiB { Volume.Update update(); /** The template for Volume update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSizeGiB { + interface Update extends UpdateStages.WithSizeGiB { /** * Executes the update request. * @@ -187,16 +172,6 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithSizeGiB { } /** The Volume update stages. */ interface UpdateStages { - /** The stage of the Volume update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } /** The stage of the Volume update allowing to specify sizeGiB. */ interface WithSizeGiB { /** 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 3e8f4ac16f491..21fa1a024ac4c 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 @@ -7,7 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; -import java.util.Map; +import java.util.List; /** An immutable client-side representation of VolumeGroup. */ public interface VolumeGroup { @@ -33,19 +33,12 @@ public interface VolumeGroup { String type(); /** - * Gets the systemData property: Resource metadata required by ARM RPC. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); - /** - * Gets the tags property: Azure resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the provisioningState property: State of the operation on the resource. * @@ -74,6 +67,13 @@ public interface VolumeGroup { */ NetworkRuleSet networkAcls(); + /** + * Gets the privateEndpointConnections property: The list of Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * Gets the name of the resource group. * @@ -113,8 +113,7 @@ interface WithParentResource { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithProtocolType, + extends DefinitionStages.WithProtocolType, DefinitionStages.WithEncryption, DefinitionStages.WithNetworkAcls { /** @@ -132,16 +131,6 @@ interface WithCreate */ VolumeGroup create(Context context); } - /** The stage of the VolumeGroup definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Azure resource tags.. - * - * @param tags Azure resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } /** The stage of the VolumeGroup definition allowing to specify protocolType. */ interface WithProtocolType { /** @@ -182,7 +171,7 @@ interface WithNetworkAcls { VolumeGroup.Update update(); /** The template for VolumeGroup update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProtocolType, UpdateStages.WithEncryption { + interface Update extends UpdateStages.WithProtocolType, UpdateStages.WithEncryption { /** * Executes the update request. * @@ -200,16 +189,6 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithProtocolType, U } /** The VolumeGroup update stages. */ interface UpdateStages { - /** The stage of the VolumeGroup update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } /** The stage of the VolumeGroup update allowing to specify protocolType. */ interface WithProtocolType { /** diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java index c554918a13142..46cfb5bc5d9b7 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupList.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.elasticsan.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,7 +15,7 @@ public final class VolumeGroupList { /* * An array of Volume Groups objects. */ - @JsonProperty(value = "value", required = true) + @JsonProperty(value = "value") private List value; /* @@ -64,14 +63,8 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model VolumeGroupList")); - } else { + if (value() != null) { value().forEach(e -> e.validate()); } } - - private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupList.class); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupUpdate.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeGroupUpdate.java index 3f3608bf31d15..2e44d8ae2e145 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 @@ -6,9 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupUpdateProperties; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; /** Volume Group request. */ @Fluent @@ -19,13 +17,6 @@ public final class VolumeGroupUpdate { @JsonProperty(value = "properties") private VolumeGroupUpdateProperties innerProperties; - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - /** Creates an instance of VolumeGroupUpdate class. */ public VolumeGroupUpdate() { } @@ -39,26 +30,6 @@ private VolumeGroupUpdateProperties innerProperties() { return this.innerProperties; } - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the VolumeGroupUpdate object itself. - */ - public VolumeGroupUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - /** * Get the protocolType property: Type of storage target. * diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java index b5f798db1b3a8..8dbd8355fe291 100644 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeList.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.elasticsan.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -16,7 +15,7 @@ public final class VolumeList { /* * An array of Volume objects. */ - @JsonProperty(value = "value", required = true) + @JsonProperty(value = "value") private List value; /* @@ -64,14 +63,8 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model VolumeList")); - } else { + if (value() != null) { value().forEach(e -> e.validate()); } } - - private static final ClientLogger LOGGER = new ClientLogger(VolumeList.class); } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeUpdate.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/models/VolumeUpdate.java index 44497c47ecd88..2113a831b4cd3 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 @@ -6,9 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.elasticsan.fluent.models.VolumeUpdateProperties; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; /** Response for Volume request. */ @Fluent @@ -19,13 +17,6 @@ public final class VolumeUpdate { @JsonProperty(value = "properties") private VolumeUpdateProperties innerProperties; - /* - * Resource tags. - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - /** Creates an instance of VolumeUpdate class. */ public VolumeUpdate() { } @@ -39,26 +30,6 @@ private VolumeUpdateProperties innerProperties() { return this.innerProperties; } - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the VolumeUpdate object itself. - */ - public VolumeUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - /** * Get the sizeGiB property: Volume size. * 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 58d1d3a237288..5691405069199 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 @@ -14,7 +14,7 @@ /** Samples for ElasticSans Create. */ public final class ElasticSansCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MaximumSet_Gen. @@ -24,19 +24,19 @@ public final class ElasticSansCreateSamples { public static void elasticSansCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .elasticSans() - .define("ti7q-k952-1qB3J_5") - .withRegion("aaaaaaaaaaaaaaaaaaaaaaaaaaa") - .withExistingResourceGroup("rgelasticsan") + .define("elasticsanname") + .withRegion("South Central US") + .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withBaseSizeTiB(26L) - .withExtendedCapacitySizeTiB(7L) - .withTags(mapOf("key896", "aaaaaaaaaaaaaaaaaa")) - .withAvailabilityZones(Arrays.asList("aaaaaaaaaaaaaaaaa")) + .withBaseSizeTiB(5L) + .withExtendedCapacitySizeTiB(25L) + .withTags(mapOf("key9316", "ihndtieqibtob")) + .withAvailabilityZones(Arrays.asList("1")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Create_MinimumSet_Gen. @@ -46,12 +46,12 @@ public static void elasticSansCreateMaximumSetGen(com.azure.resourcemanager.elas public static void elasticSansCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .elasticSans() - .define("ti7q-k952-1qB3J_5") - .withRegion((String) null) - .withExistingResourceGroup("rgelasticsan") + .define("elasticsanname") + .withRegion("South Central US") + .withExistingResourceGroup("resourcegroupname") .withSku(new Sku().withName(SkuName.PREMIUM_LRS)) - .withBaseSizeTiB(26L) - .withExtendedCapacitySizeTiB(7L) + .withBaseSizeTiB(5L) + .withExtendedCapacitySizeTiB(25L) .create(); } 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 9671d09174479..1aaa79bd07650 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for ElasticSans Delete. */ public final class ElasticSansDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MinimumSet_Gen. @@ -17,11 +15,11 @@ public final class ElasticSansDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void elasticSansDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().delete("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager.elasticSans().delete("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Delete_MaximumSet_Gen. @@ -29,6 +27,6 @@ public static void elasticSansDeleteMinimumSetGen(com.azure.resourcemanager.elas * @param manager Entry point to ElasticSanManager. */ public static void elasticSansDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().delete("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager.elasticSans().delete("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansGetByResourceGroupSamples.java index eef933d73efc7..87c4bea3033a9 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for ElasticSans GetByResourceGroup. */ public final class ElasticSansGetByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MinimumSet_Gen. @@ -17,11 +15,13 @@ public final class ElasticSansGetByResourceGroupSamples { * @param manager Entry point to ElasticSanManager. */ public static void elasticSansGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .elasticSans() + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Get_MaximumSet_Gen. @@ -29,6 +29,8 @@ public static void elasticSansGetMinimumSetGen(com.azure.resourcemanager.elastic * @param manager Entry point to ElasticSanManager. */ public static void elasticSansGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .elasticSans() + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListByResourceGroupSamples.java index 9fcbd4f0e7188..9f73e5041e1ee 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for ElasticSans ListByResourceGroup. */ public final class ElasticSansListByResourceGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MinimumSet_Gen. @@ -18,11 +16,11 @@ public final class ElasticSansListByResourceGroupSamples { */ public static void elasticSansListByResourceGroupMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().listByResourceGroup("rgelasticsan", Context.NONE); + manager.elasticSans().listByResourceGroup("resourcegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen. @@ -31,6 +29,6 @@ public static void elasticSansListByResourceGroupMinimumSetGen( */ public static void elasticSansListByResourceGroupMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().listByResourceGroup("rgelasticsan", Context.NONE); + manager.elasticSans().listByResourceGroup("resourcegroupname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListSamples.java index 84339e12f3f88..0db886cd355e0 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for ElasticSans List. */ public final class ElasticSansListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen. @@ -18,11 +16,11 @@ public final class ElasticSansListSamples { */ public static void elasticSansListBySubscriptionMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().list(Context.NONE); + manager.elasticSans().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_ListBySubscription_MinimumSet_Gen. @@ -31,6 +29,6 @@ public static void elasticSansListBySubscriptionMaximumSetGen( */ public static void elasticSansListBySubscriptionMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.elasticSans().list(Context.NONE); + manager.elasticSans().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansUpdateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansUpdateSamples.java index dfe9a3d248d77..af4bd7562208d 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 @@ -4,7 +4,6 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.models.ElasticSan; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for ElasticSans Update. */ public final class ElasticSansUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MinimumSet_Gen. @@ -23,13 +22,13 @@ public static void elasticSansUpdateMinimumSetGen(com.azure.resourcemanager.elas ElasticSan resource = manager .elasticSans() - .getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE) + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE) .getValue(); resource.update().apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json */ /** * Sample code: ElasticSans_Update_MaximumSet_Gen. @@ -40,9 +39,9 @@ public static void elasticSansUpdateMaximumSetGen(com.azure.resourcemanager.elas ElasticSan resource = manager .elasticSans() - .getByResourceGroupWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE) + .getByResourceGroupWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("key3137", "aaaaaaaaaaaaaaa")).apply(); + resource.update().withTags(mapOf("key4212", "cqvcnwfefljntgeio")).apply(); } @SuppressWarnings("unchecked") 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 632cc88039850..9d24e55e821c1 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -17,11 +15,11 @@ public final class OperationsListSamples { * @param manager Entry point to ElasticSanManager. */ public static void operationsListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. @@ -29,6 +27,6 @@ public static void operationsListMinimumSetGen(com.azure.resourcemanager.elastic * @param manager Entry point to ElasticSanManager. */ public static void operationsListMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } 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 new file mode 100644 index 0000000000000..a5316575ab014 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsCreateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +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; + +/** 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 + */ + /** + * Sample code: PrivateEndpointConnections_Create_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsCreateMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .define("privateendpointconnectionname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("Auto-Approved") + .withActionsRequired("None")) + .withPrivateEndpoint(new PrivateEndpoint()) + .withGroupIds(Arrays.asList("sytxzqlcoapcaywthgwvwcw")) + .create(); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_Create_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsCreateMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .define("privateendpointconnectionname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("Auto-Approved") + .withActionsRequired("None")) + .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 new file mode 100644 index 0000000000000..e2b7a8301887e --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsDeleteSamples.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 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 + */ + /** + * Sample code: PrivateEndpointConnections_Delete_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsDeleteMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsDeleteMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .delete( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..4e490d926fbdf --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsGetSamples.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 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 + */ + /** + * Sample code: PrivateEndpointConnections_Get_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsGetMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_Get_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsGetMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "privateendpointconnectionname", + com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..1ca2a21af2833 --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +/** 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 + */ + /** + * Sample code: PrivateEndpointConnections_List_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsListMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .list("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateEndpointConnections_List_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateEndpointConnectionsListMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateEndpointConnections() + .list("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } +} 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 new file mode 100644 index 0000000000000..a858cb253039a --- /dev/null +++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/PrivateLinkResourcesListByElasticSanSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.elasticsan.generated; + +/** 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 + */ + /** + * Sample code: PrivateLinkResources_ListByElasticSan_MinimumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateLinkResourcesListByElasticSanMinimumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateLinkResources() + .listByElasticSanWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + */ + /** + * Sample code: PrivateLinkResources_ListByElasticSan_MaximumSet_Gen. + * + * @param manager Entry point to ElasticSanManager. + */ + public static void privateLinkResourcesListByElasticSanMaximumSetGen( + com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { + manager + .privateLinkResources() + .listByElasticSanWithResponse("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/SkusListSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/SkusListSamples.java index eb58e167ea4ad..a1ebf18f87b61 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for Skus List. */ public final class SkusListSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MinimumSet_Gen.json */ /** * Sample code: Skus_List_MinimumSet_Gen. @@ -17,11 +15,11 @@ public final class SkusListSamples { * @param manager Entry point to ElasticSanManager. */ public static void skusListMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.skus().list(null, Context.NONE); + manager.skus().list(null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MaximumSet_Gen.json */ /** * Sample code: Skus_List_MaximumSet_Gen. @@ -29,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("aaaa", Context.NONE); + manager.skus().list("dtycml", 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 c05d6a12492dc..aa7ea8db0ccc0 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 @@ -10,13 +10,11 @@ import com.azure.resourcemanager.elasticsan.models.StorageTargetType; import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; /** Samples for VolumeGroups Create. */ public final class VolumeGroupsCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MinimumSet_Gen. @@ -26,13 +24,13 @@ public final class VolumeGroupsCreateSamples { public static void volumeGroupsCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumeGroups() - .define("u_5I_1j4t3") - .withExistingElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5") + .define("volumegroupname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Create_MaximumSet_Gen. @@ -42,9 +40,8 @@ public static void volumeGroupsCreateMinimumSetGen(com.azure.resourcemanager.ela public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumeGroups() - .define("u_5I_1j4t3") - .withExistingElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5") - .withTags(mapOf("key5933", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) + .define("volumegroupname") + .withExistingElasticSan("resourcegroupname", "elasticsanname") .withProtocolType(StorageTargetType.ISCSI) .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) .withNetworkAcls( @@ -53,19 +50,9 @@ public static void volumeGroupsCreateMaximumSetGen(com.azure.resourcemanager.ela Arrays .asList( new VirtualNetworkRule() - .withVirtualNetworkResourceId("aaaaaaaaaaaaaaaa") + .withVirtualNetworkResourceId( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}") .withAction(Action.ALLOW)))) .create(); } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteSamples.java index 2d1995ed2ba85..7b670f975010e 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for VolumeGroups Delete. */ public final class VolumeGroupsDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MinimumSet_Gen. @@ -17,11 +15,13 @@ public final class VolumeGroupsDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .delete("resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Delete_MaximumSet_Gen. @@ -29,6 +29,8 @@ public static void volumeGroupsDeleteMinimumSetGen(com.azure.resourcemanager.ela * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .delete("resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsGetSamples.java index 23d03550e4459..db858e1eef0c6 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for VolumeGroups Get. */ public final class VolumeGroupsGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MinimumSet_Gen. @@ -17,11 +15,14 @@ public final class VolumeGroupsGetSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Get_MaximumSet_Gen. @@ -29,6 +30,9 @@ public static void volumeGroupsGetMinimumSetGen(com.azure.resourcemanager.elasti * @param manager Entry point to ElasticSanManager. */ public static void volumeGroupsGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumeGroups() + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanSamples.java index 94bcf510e49c4..fc557b4cec54b 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for VolumeGroups ListByElasticSan. */ public final class VolumeGroupsListByElasticSanSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen. @@ -18,11 +16,13 @@ public final class VolumeGroupsListByElasticSanSamples { */ public static void volumeGroupsListByElasticSanMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().listByElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .volumeGroups() + .listByElasticSan("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen. @@ -31,6 +31,8 @@ public static void volumeGroupsListByElasticSanMinimumSetGen( */ public static void volumeGroupsListByElasticSanMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumeGroups().listByElasticSan("rgelasticsan", "ti7q-k952-1qB3J_5", Context.NONE); + manager + .volumeGroups() + .listByElasticSan("resourcegroupname", "elasticsanname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsUpdateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsUpdateSamples.java index 5c1f349fc1a1c..5b767c456c00f 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,17 +4,14 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.models.EncryptionType; import com.azure.resourcemanager.elasticsan.models.StorageTargetType; import com.azure.resourcemanager.elasticsan.models.VolumeGroup; -import java.util.HashMap; -import java.util.Map; /** Samples for VolumeGroups Update. */ public final class VolumeGroupsUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MaximumSet_Gen. @@ -25,18 +22,18 @@ public static void volumeGroupsUpdateMaximumSetGen(com.azure.resourcemanager.ela VolumeGroup resource = manager .volumeGroups() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE) + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE) .getValue(); resource .update() - .withTags(mapOf("key7542", "aaaaaaaaaaaaaaaaaaaa")) .withProtocolType(StorageTargetType.ISCSI) .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) .apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json */ /** * Sample code: VolumeGroups_Update_MinimumSet_Gen. @@ -47,19 +44,9 @@ public static void volumeGroupsUpdateMinimumSetGen(com.azure.resourcemanager.ela VolumeGroup resource = manager .volumeGroups() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE) + .getWithResponse( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE) .getValue(); resource.update().apply(); } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateSamples.java index 37b690d47c0ae..6a167e8679f09 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 @@ -6,13 +6,11 @@ import com.azure.resourcemanager.elasticsan.models.SourceCreationData; import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import java.util.HashMap; -import java.util.Map; /** Samples for Volumes Create. */ public final class VolumesCreateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MaximumSet_Gen.json */ /** * Sample code: Volumes_Create_MaximumSet_Gen. @@ -22,17 +20,16 @@ public final class VolumesCreateSamples { public static void volumesCreateMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumes() - .define("9132y") - .withExistingVolumegroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3") - .withTags(mapOf("key7423", "aaaa")) + .define("volumename") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withSizeGiB(23L) .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("aaaaaa")) - .withSizeGiB(22L) + new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri(" ARM Id of resource")) .create(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MinimumSet_Gen.json */ /** * Sample code: Volumes_Create_MinimumSet_Gen. @@ -42,19 +39,9 @@ public static void volumesCreateMaximumSetGen(com.azure.resourcemanager.elastics public static void volumesCreateMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { manager .volumes() - .define("9132y") - .withExistingVolumegroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3") + .define("volumename") + .withExistingVolumegroup("resourcegroupname", "elasticsanname", "volumegroupname") + .withSizeGiB(23L) .create(); } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteSamples.java index ede024c0a6e74..9ab4db6eacd25 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,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for Volumes Delete. */ public final class VolumesDeleteSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json */ /** * Sample code: Volumes_Delete_MinimumSet_Gen. @@ -17,11 +15,18 @@ public final class VolumesDeleteSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumesDeleteMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json */ /** * Sample code: Volumes_Delete_MaximumSet_Gen. @@ -29,6 +34,13 @@ public static void volumesDeleteMinimumSetGen(com.azure.resourcemanager.elastics * @param manager Entry point to ElasticSanManager. */ public static void volumesDeleteMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().delete("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .delete( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + 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 fc58b8ea3bbd1..254865a24a003 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for Volumes Get. */ public final class VolumesGetSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json */ /** * Sample code: Volumes_Get_MaximumSet_Gen. @@ -17,11 +15,18 @@ public final class VolumesGetSamples { * @param manager Entry point to ElasticSanManager. */ public static void volumesGetMaximumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json */ /** * Sample code: Volumes_Get_MinimumSet_Gen. @@ -29,6 +34,13 @@ public static void volumesGetMaximumSetGen(com.azure.resourcemanager.elasticsan. * @param manager Entry point to ElasticSanManager. */ public static void volumesGetMinimumSetGen(com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE); + manager + .volumes() + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupSamples.java index bdfee4643217c..2300a87fa5cbe 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 @@ -4,12 +4,10 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; - /** Samples for Volumes ListByVolumeGroup. */ public final class VolumesListByVolumeGroupSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen. @@ -18,11 +16,14 @@ public final class VolumesListByVolumeGroupSamples { */ public static void volumesListByVolumeGroupMaximumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().listByVolumeGroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumes() + .listByVolumeGroup( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json */ /** * Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen. @@ -31,6 +32,9 @@ public static void volumesListByVolumeGroupMaximumSetGen( */ public static void volumesListByVolumeGroupMinimumSetGen( com.azure.resourcemanager.elasticsan.ElasticSanManager manager) { - manager.volumes().listByVolumeGroup("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", Context.NONE); + manager + .volumes() + .listByVolumeGroup( + "resourcegroupname", "elasticsanname", "volumegroupname", com.azure.core.util.Context.NONE); } } diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesUpdateSamples.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/samples/java/com/azure/resourcemanager/elasticsan/generated/VolumesUpdateSamples.java index 9daf5331187ef..fa82fc3007d48 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 @@ -4,15 +4,12 @@ package com.azure.resourcemanager.elasticsan.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.elasticsan.models.Volume; -import java.util.HashMap; -import java.util.Map; /** Samples for Volumes Update. */ public final class VolumesUpdateSamples { /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MinimumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MinimumSet_Gen.json */ /** * Sample code: Volumes_Update_MinimumSet_Gen. @@ -23,13 +20,18 @@ public static void volumesUpdateMinimumSetGen(com.azure.resourcemanager.elastics Volume resource = manager .volumes() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE) + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE) .getValue(); resource.update().apply(); } /* - * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MaximumSet_Gen.json + * x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MaximumSet_Gen.json */ /** * Sample code: Volumes_Update_MaximumSet_Gen. @@ -40,19 +42,13 @@ public static void volumesUpdateMaximumSetGen(com.azure.resourcemanager.elastics Volume resource = manager .volumes() - .getWithResponse("rgelasticsan", "ti7q-k952-1qB3J_5", "u_5I_1j4t3", "9132y", Context.NONE) + .getWithResponse( + "resourcegroupname", + "elasticsanname", + "volumegroupname", + "volumename", + com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("key1864", "aaaaaaaaa")).withSizeGiB(9L).apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + resource.update().withSizeGiB(11L).apply(); } } 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 caefafdb26acb..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanInnerTests.java +++ /dev/null @@ -1,65 +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; -import org.junit.jupiter.api.Test; - -public final class ElasticSanInnerTests { - @Test - public void testDeserialize() { - ElasticSanInner model = - BinaryData - .fromString( - "{\"properties\":{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"dhugjzzdatqxhocd\",\"eablg\",\"huticndvkao\",\"wyiftyhxhur\"],\"provisioningState\":\"Pending\",\"baseSizeTiB\":2402259301927489199,\"extendedCapacitySizeTiB\":5881942076944182815,\"totalVolumeSizeGiB\":921409398987301775,\"volumeGroupCount\":6179231024758193483,\"totalIops\":4659788042682990061,\"totalMBps\":8901004615962760230,\"totalSizeTiB\":8355721007467412768},\"location\":\"xklrypl\",\"tags\":{\"nddhsgcbacph\":\"basyy\",\"nqgoulzndli\":\"jkot\"},\"id\":\"wyqkgfgibm\",\"name\":\"dgak\",\"type\":\"qsrxybzqqed\"}") - .toObject(ElasticSanInner.class); - Assertions.assertEquals("xklrypl", model.location()); - Assertions.assertEquals("basyy", model.tags().get("nddhsgcbacph")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("dhugjzzdatqxhocd", model.availabilityZones().get(0)); - Assertions.assertEquals(2402259301927489199L, model.baseSizeTiB()); - Assertions.assertEquals(5881942076944182815L, model.extendedCapacitySizeTiB()); - } - - @Test - public void testSerialize() { - ElasticSanInner model = - new ElasticSanInner() - .withLocation("xklrypl") - .withTags(mapOf("nddhsgcbacph", "basyy", "nqgoulzndli", "jkot")) - .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withAvailabilityZones(Arrays.asList("dhugjzzdatqxhocd", "eablg", "huticndvkao", "wyiftyhxhur")) - .withBaseSizeTiB(2402259301927489199L) - .withExtendedCapacitySizeTiB(5881942076944182815L); - model = BinaryData.fromObject(model).toObject(ElasticSanInner.class); - Assertions.assertEquals("xklrypl", model.location()); - Assertions.assertEquals("basyy", model.tags().get("nddhsgcbacph")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("dhugjzzdatqxhocd", model.availabilityZones().get(0)); - Assertions.assertEquals(2402259301927489199L, model.baseSizeTiB()); - Assertions.assertEquals(5881942076944182815L, 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 3c6ab41654cfa..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanListTests.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.util.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner; -import com.azure.resourcemanager.elasticsan.models.ElasticSanList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ElasticSanListTests { - @Test - public void testDeserialize() { - ElasticSanList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"availabilityZones\":[],\"provisioningState\":\"Canceled\",\"baseSizeTiB\":3184798608963341660,\"extendedCapacitySizeTiB\":7384654236871166867,\"totalVolumeSizeGiB\":1235321626273843425,\"volumeGroupCount\":1798808176540213287,\"totalIops\":548063352355670740,\"totalMBps\":8213986203807393703,\"totalSizeTiB\":2711659806667039097},\"location\":\"oqpsoa\",\"tags\":{\"lahbcryff\":\"azakl\",\"xpaojakhmsbz\":\"fdosyg\"},\"id\":\"hcrzevd\",\"name\":\"hlxaolthqtr\",\"type\":\"qjbpfzfsin\"},{\"properties\":{\"availabilityZones\":[],\"provisioningState\":\"Invalid\",\"baseSizeTiB\":7322937378922398277,\"extendedCapacitySizeTiB\":7992644322804744623,\"totalVolumeSizeGiB\":4223016472097191780,\"volumeGroupCount\":482662408665248434,\"totalIops\":3412970068315160824,\"totalMBps\":1814795871426481160,\"totalSizeTiB\":6619682147047690446},\"location\":\"onpeqfpjkjlxofp\",\"tags\":{\"ininmay\":\"pfxxy\"},\"id\":\"uybbkpodep\",\"name\":\"oginuvamiheognar\",\"type\":\"zxtheotusivyevcc\"},{\"properties\":{\"availabilityZones\":[],\"provisioningState\":\"Invalid\",\"baseSizeTiB\":7067055679809849954,\"extendedCapacitySizeTiB\":1816098000378233348,\"totalVolumeSizeGiB\":5390210945061154066,\"volumeGroupCount\":3639417150615550339,\"totalIops\":7164161557812363211,\"totalMBps\":7935280975021078838,\"totalSizeTiB\":642697020628687872},\"location\":\"mvtzfkufub\",\"tags\":{\"aeqjhqjbasvms\":\"fxqeof\"},\"id\":\"jqul\",\"name\":\"gsntnbybkzgcwr\",\"type\":\"clxxwrljdo\"},{\"properties\":{\"availabilityZones\":[],\"provisioningState\":\"Updating\",\"baseSizeTiB\":5217590058761942441,\"extendedCapacitySizeTiB\":4865478979118542149,\"totalVolumeSizeGiB\":4105956732446438238,\"volumeGroupCount\":4350349194927395278,\"totalIops\":5768373522529510794,\"totalMBps\":104740040232311726,\"totalSizeTiB\":5581291117453536479},\"location\":\"ksqrglssai\",\"tags\":{\"eebvmgxsab\":\"jwnzlljfmp\"},\"id\":\"yqduujit\",\"name\":\"jczdzevndh\",\"type\":\"rwpdappdsbdkvwrw\"}],\"nextLink\":\"eusnhutj\"}") - .toObject(ElasticSanList.class); - Assertions.assertEquals("oqpsoa", model.value().get(0).location()); - Assertions.assertEquals("azakl", model.value().get(0).tags().get("lahbcryff")); - Assertions.assertEquals(3184798608963341660L, model.value().get(0).baseSizeTiB()); - Assertions.assertEquals(7384654236871166867L, model.value().get(0).extendedCapacitySizeTiB()); - } - - @Test - public void testSerialize() { - ElasticSanList model = - new ElasticSanList() - .withValue( - Arrays - .asList( - new ElasticSanInner() - .withLocation("oqpsoa") - .withTags(mapOf("lahbcryff", "azakl", "xpaojakhmsbz", "fdosyg")) - .withAvailabilityZones(Arrays.asList()) - .withBaseSizeTiB(3184798608963341660L) - .withExtendedCapacitySizeTiB(7384654236871166867L), - new ElasticSanInner() - .withLocation("onpeqfpjkjlxofp") - .withTags(mapOf("ininmay", "pfxxy")) - .withAvailabilityZones(Arrays.asList()) - .withBaseSizeTiB(7322937378922398277L) - .withExtendedCapacitySizeTiB(7992644322804744623L), - new ElasticSanInner() - .withLocation("mvtzfkufub") - .withTags(mapOf("aeqjhqjbasvms", "fxqeof")) - .withAvailabilityZones(Arrays.asList()) - .withBaseSizeTiB(7067055679809849954L) - .withExtendedCapacitySizeTiB(1816098000378233348L), - new ElasticSanInner() - .withLocation("ksqrglssai") - .withTags(mapOf("eebvmgxsab", "jwnzlljfmp")) - .withAvailabilityZones(Arrays.asList()) - .withBaseSizeTiB(5217590058761942441L) - .withExtendedCapacitySizeTiB(4865478979118542149L))); - model = BinaryData.fromObject(model).toObject(ElasticSanList.class); - Assertions.assertEquals("oqpsoa", model.value().get(0).location()); - Assertions.assertEquals("azakl", model.value().get(0).tags().get("lahbcryff")); - Assertions.assertEquals(3184798608963341660L, model.value().get(0).baseSizeTiB()); - Assertions.assertEquals(7384654236871166867L, 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/ElasticSanOperationDisplayTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanOperationDisplayTests.java deleted file mode 100644 index 5277511e3a11c..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanOperationDisplayTests.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.ElasticSanOperationDisplay; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ElasticSanOperationDisplayTests { - @Test - public void testDeserialize() { - ElasticSanOperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"poyfdkfogkn\",\"resource\":\"gjofjd\",\"operation\":\"eqsrdeupewnwreit\",\"description\":\"zyf\"}") - .toObject(ElasticSanOperationDisplay.class); - Assertions.assertEquals("poyfdkfogkn", model.provider()); - Assertions.assertEquals("gjofjd", model.resource()); - Assertions.assertEquals("eqsrdeupewnwreit", model.operation()); - Assertions.assertEquals("zyf", model.description()); - } - - @Test - public void testSerialize() { - ElasticSanOperationDisplay model = - new ElasticSanOperationDisplay() - .withProvider("poyfdkfogkn") - .withResource("gjofjd") - .withOperation("eqsrdeupewnwreit") - .withDescription("zyf"); - model = BinaryData.fromObject(model).toObject(ElasticSanOperationDisplay.class); - Assertions.assertEquals("poyfdkfogkn", model.provider()); - Assertions.assertEquals("gjofjd", model.resource()); - Assertions.assertEquals("eqsrdeupewnwreit", model.operation()); - Assertions.assertEquals("zyf", model.description()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanOperationListResultTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanOperationListResultTests.java deleted file mode 100644 index cabd70fb7e9c6..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanOperationListResultTests.java +++ /dev/null @@ -1,41 +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.ElasticSanRPOperationInner; -import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ElasticSanOperationListResultTests { - @Test - public void testDeserialize() { - ElasticSanOperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"mhquvgjxp\",\"isDataAction\":true,\"display\":{\"provider\":\"m\",\"resource\":\"hmtzopbsphrup\",\"operation\":\"dgs\",\"description\":\"bb\"}},{\"name\":\"jhphoyc\",\"isDataAction\":true,\"display\":{\"provider\":\"obhdxbmtqioqjze\",\"resource\":\"tbmufpo\",\"operation\":\"noi\",\"description\":\"hwlrx\"}},{\"name\":\"bqsoqijg\",\"isDataAction\":true,\"display\":{\"provider\":\"pazlobcufpdz\",\"resource\":\"rbt\",\"operation\":\"qqjnqgl\",\"description\":\"qgn\"}}],\"nextLink\":\"ooojywifsqe\"}") - .toObject(ElasticSanOperationListResult.class); - Assertions.assertEquals("mhquvgjxp", model.value().get(0).name()); - Assertions.assertEquals("ooojywifsqe", model.nextLink()); - } - - @Test - public void testSerialize() { - ElasticSanOperationListResult model = - new ElasticSanOperationListResult() - .withValue( - Arrays - .asList( - new ElasticSanRPOperationInner().withName("mhquvgjxp"), - new ElasticSanRPOperationInner().withName("jhphoyc"), - new ElasticSanRPOperationInner().withName("bqsoqijg"))) - .withNextLink("ooojywifsqe"); - model = BinaryData.fromObject(model).toObject(ElasticSanOperationListResult.class); - Assertions.assertEquals("mhquvgjxp", model.value().get(0).name()); - Assertions.assertEquals("ooojywifsqe", model.nextLink()); - } -} 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 05a29fc7c6ad3..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanPropertiesTests.java +++ /dev/null @@ -1,46 +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; -import org.junit.jupiter.api.Test; - -public final class ElasticSanPropertiesTests { - @Test - public void testDeserialize() { - ElasticSanProperties model = - BinaryData - .fromString( - "{\"sku\":{\"name\":\"Premium_LRS\",\"tier\":\"Premium\"},\"availabilityZones\":[\"qfou\",\"lmmnkzsmodmglo\",\"gpbkwtmut\"],\"provisioningState\":\"Updating\",\"baseSizeTiB\":6527154524069647921,\"extendedCapacitySizeTiB\":1771403867569508229,\"totalVolumeSizeGiB\":52315490134475287,\"volumeGroupCount\":6844497267979767976,\"totalIops\":1162811232812995218,\"totalMBps\":3925308584978476249,\"totalSizeTiB\":438414223496146257}") - .toObject(ElasticSanProperties.class); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("qfou", model.availabilityZones().get(0)); - Assertions.assertEquals(6527154524069647921L, model.baseSizeTiB()); - Assertions.assertEquals(1771403867569508229L, model.extendedCapacitySizeTiB()); - } - - @Test - public void testSerialize() { - ElasticSanProperties model = - new ElasticSanProperties() - .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withAvailabilityZones(Arrays.asList("qfou", "lmmnkzsmodmglo", "gpbkwtmut")) - .withBaseSizeTiB(6527154524069647921L) - .withExtendedCapacitySizeTiB(1771403867569508229L); - model = BinaryData.fromObject(model).toObject(ElasticSanProperties.class); - Assertions.assertEquals(SkuName.PREMIUM_LRS, model.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("qfou", model.availabilityZones().get(0)); - Assertions.assertEquals(6527154524069647921L, model.baseSizeTiB()); - Assertions.assertEquals(1771403867569508229L, model.extendedCapacitySizeTiB()); - } -} diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanRPOperationInnerTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanRPOperationInnerTests.java deleted file mode 100644 index be10fe7703667..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanRPOperationInnerTests.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.fluent.models.ElasticSanRPOperationInner; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ElasticSanRPOperationInnerTests { - @Test - public void testDeserialize() { - ElasticSanRPOperationInner model = - BinaryData - .fromString( - "{\"name\":\"aagdfmg\",\"isDataAction\":false,\"display\":{\"provider\":\"j\",\"resource\":\"rifkwm\",\"operation\":\"vktsizntocipao\",\"description\":\"ajpsquc\"}}") - .toObject(ElasticSanRPOperationInner.class); - Assertions.assertEquals("aagdfmg", model.name()); - } - - @Test - public void testSerialize() { - ElasticSanRPOperationInner model = new ElasticSanRPOperationInner().withName("aagdfmg"); - model = BinaryData.fromObject(model).toObject(ElasticSanRPOperationInner.class); - Assertions.assertEquals("aagdfmg", model.name()); - } -} 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 69553d9655be3..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdatePropertiesTests.java +++ /dev/null @@ -1,33 +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; -import org.junit.jupiter.api.Test; - -public final class ElasticSanUpdatePropertiesTests { - @Test - public void testDeserialize() { - ElasticSanUpdateProperties model = - BinaryData - .fromString("{\"baseSizeTiB\":907638754546671193,\"extendedCapacitySizeTiB\":1576812091412764436}") - .toObject(ElasticSanUpdateProperties.class); - Assertions.assertEquals(907638754546671193L, model.baseSizeTiB()); - Assertions.assertEquals(1576812091412764436L, model.extendedCapacitySizeTiB()); - } - - @Test - public void testSerialize() { - ElasticSanUpdateProperties model = - new ElasticSanUpdateProperties() - .withBaseSizeTiB(907638754546671193L) - .withExtendedCapacitySizeTiB(1576812091412764436L); - model = BinaryData.fromObject(model).toObject(ElasticSanUpdateProperties.class); - Assertions.assertEquals(907638754546671193L, model.baseSizeTiB()); - Assertions.assertEquals(1576812091412764436L, 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 612dfe344cc07..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSanUpdateTests.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.models.ElasticSanUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ElasticSanUpdateTests { - @Test - public void testDeserialize() { - ElasticSanUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"baseSizeTiB\":1046762399333359388,\"extendedCapacitySizeTiB\":6432231641159211987},\"tags\":{\"bexppb\":\"ddgmb\"}}") - .toObject(ElasticSanUpdate.class); - Assertions.assertEquals("ddgmb", model.tags().get("bexppb")); - Assertions.assertEquals(1046762399333359388L, model.baseSizeTiB()); - Assertions.assertEquals(6432231641159211987L, model.extendedCapacitySizeTiB()); - } - - @Test - public void testSerialize() { - ElasticSanUpdate model = - new ElasticSanUpdate() - .withTags(mapOf("bexppb", "ddgmb")) - .withBaseSizeTiB(1046762399333359388L) - .withExtendedCapacitySizeTiB(6432231641159211987L); - model = BinaryData.fromObject(model).toObject(ElasticSanUpdate.class); - Assertions.assertEquals("ddgmb", model.tags().get("bexppb")); - Assertions.assertEquals(1046762399333359388L, model.baseSizeTiB()); - Assertions.assertEquals(6432231641159211987L, 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 18cdafdb95bfa..0000000000000 --- 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\":[\"nuqqkpikadrgvt\",\"agnb\",\"ynhijggme\"],\"provisioningState\":\"Succeeded\",\"baseSizeTiB\":3996731828739891249,\"extendedCapacitySizeTiB\":2578720957092092730,\"totalVolumeSizeGiB\":3371222467349281870,\"volumeGroupCount\":7973446433897202047,\"totalIops\":4751429642100442648,\"totalMBps\":7222768982101103933,\"totalSizeTiB\":4980695192319165499},\"location\":\"mpxttdbhrbnlankx\",\"tags\":{\"bhenbtkcxywnyt\":\"k\",\"qidybyx\":\"rsyn\",\"aaxdbabphlwrq\":\"zfcl\",\"hsucoc\":\"fkts\"},\"id\":\"nyyazttbtwwrqpue\",\"name\":\"ckzywbiexzfeyue\",\"type\":\"xibxujwbhqwalm\"}"; - - 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("ctq") - .withRegion("uujqgidokgjljyo") - .withExistingResourceGroup("fcivfsnkym") - .withSku(new Sku().withName(SkuName.PREMIUM_LRS).withTier(SkuTier.PREMIUM)) - .withBaseSizeTiB(3045302180420879642L) - .withExtendedCapacitySizeTiB(2013084954384756967L) - .withTags(mapOf("hbijhtxfvgxb", "cltbgsncghkjesz", "eh", "smx", "qkkrb", "pvecxgodeb")) - .withAvailabilityZones(Arrays.asList("rjcxerfuwu", "ttxfvjr")) - .create(); - - Assertions.assertEquals("mpxttdbhrbnlankx", response.location()); - Assertions.assertEquals("k", response.tags().get("bhenbtkcxywnyt")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("nuqqkpikadrgvt", response.availabilityZones().get(0)); - Assertions.assertEquals(3996731828739891249L, response.baseSizeTiB()); - Assertions.assertEquals(2578720957092092730L, 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 cf6dd5d490962..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansDeleteMockTests.java +++ /dev/null @@ -1,62 +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.core.util.Context; -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("frzpwvlqdqgb", "qylihkaetckt", Context.NONE); - } -} 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 215189f9f17bc..0000000000000 --- 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.core.util.Context; -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\":[\"pu\",\"tmryw\",\"uzoqft\",\"yqzrnkcqvyxlw\"],\"provisioningState\":\"Creating\",\"baseSizeTiB\":5878187875852963260,\"extendedCapacitySizeTiB\":5175708823620809129,\"totalVolumeSizeGiB\":2581341123094778316,\"volumeGroupCount\":8790977407695339630,\"totalIops\":4925089192902964395,\"totalMBps\":590207966929645697,\"totalSizeTiB\":3720293766477653442},\"location\":\"unmmq\",\"tags\":{\"ocukoklyax\":\"xzko\"},\"id\":\"conuqszfkbeype\",\"name\":\"rmjmwvvjektc\",\"type\":\"senhwlrs\"}]}"; - - 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("kix", Context.NONE); - - Assertions.assertEquals("unmmq", response.iterator().next().location()); - Assertions.assertEquals("xzko", response.iterator().next().tags().get("ocukoklyax")); - Assertions.assertEquals(SkuName.PREMIUM_LRS, response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("pu", response.iterator().next().availabilityZones().get(0)); - Assertions.assertEquals(5878187875852963260L, response.iterator().next().baseSizeTiB()); - Assertions.assertEquals(5175708823620809129L, 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 a4f19241d6ea7..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/ElasticSansListMockTests.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.core.util.Context; -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\":[\"jx\",\"jnspydp\"],\"provisioningState\":\"Updating\",\"baseSizeTiB\":2872617202997783845,\"extendedCapacitySizeTiB\":3980056682158656120,\"totalVolumeSizeGiB\":3290062663385259489,\"volumeGroupCount\":316131865784554272,\"totalIops\":5918766078843387031,\"totalMBps\":5757208941637083541,\"totalSizeTiB\":2493670032116286006},\"location\":\"kpoc\",\"tags\":{\"xoegukgjnpiucgy\":\"z\",\"zcdrqjsdpydnfyhx\":\"evqzntypmrbp\",\"ifsjttgzfbishcb\":\"eoejzic\"},\"id\":\"hajdeyeamdpha\",\"name\":\"alpbuxwgipwhon\",\"type\":\"wkgshwa\"}]}"; - - 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(Context.NONE); - - Assertions.assertEquals("kpoc", response.iterator().next().location()); - Assertions.assertEquals("z", response.iterator().next().tags().get("xoegukgjnpiucgy")); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("jx", response.iterator().next().availabilityZones().get(0)); - Assertions.assertEquals(2872617202997783845L, response.iterator().next().baseSizeTiB()); - Assertions.assertEquals(3980056682158656120L, 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 6a5227f3a57af..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/IscsiTargetInfoTests.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.IscsiTargetInfo; -import com.azure.resourcemanager.elasticsan.models.OperationalStatus; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IscsiTargetInfoTests { - @Test - public void testDeserialize() { - IscsiTargetInfo model = - BinaryData - .fromString( - "{\"targetIqn\":\"nj\",\"targetPortalHostname\":\"lwtgrhpdj\",\"targetPortalPort\":523400535,\"provisioningState\":\"Deleting\",\"status\":\"Running\"}") - .toObject(IscsiTargetInfo.class); - Assertions.assertEquals(OperationalStatus.RUNNING, model.status()); - } - - @Test - public void testSerialize() { - IscsiTargetInfo model = new IscsiTargetInfo().withStatus(OperationalStatus.RUNNING); - model = BinaryData.fromObject(model).toObject(IscsiTargetInfo.class); - Assertions.assertEquals(OperationalStatus.RUNNING, 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 735f978507b37..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/NetworkRuleSetTests.java +++ /dev/null @@ -1,46 +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; -import org.junit.jupiter.api.Test; - -public final class NetworkRuleSetTests { - @Test - public void testDeserialize() { - NetworkRuleSet model = - BinaryData - .fromString( - "{\"virtualNetworkRules\":[{\"id\":\"nxqbzvddn\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"},{\"id\":\"icbtwnpzao\",\"action\":\"Allow\",\"state\":\"provisioning\"},{\"id\":\"hcffcyddglmjthjq\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"},{\"id\":\"icxm\",\"action\":\"Allow\",\"state\":\"deprovisioning\"}]}") - .toObject(NetworkRuleSet.class); - Assertions.assertEquals("nxqbzvddn", model.virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.virtualNetworkRules().get(0).action()); - } - - @Test - public void testSerialize() { - NetworkRuleSet model = - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule().withVirtualNetworkResourceId("nxqbzvddn").withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("icbtwnpzao") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("hcffcyddglmjthjq") - .withAction(Action.ALLOW), - new VirtualNetworkRule().withVirtualNetworkResourceId("icxm").withAction(Action.ALLOW))); - model = BinaryData.fromObject(model).toObject(NetworkRuleSet.class); - Assertions.assertEquals("nxqbzvddn", 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/OperationsListMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationsListMockTests.java deleted file mode 100644 index b680ed3e373e6..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/OperationsListMockTests.java +++ /dev/null @@ -1,68 +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.core.util.Context; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation; -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 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\":\"ksymd\",\"isDataAction\":true,\"display\":{\"provider\":\"kiiuxhqyudxor\",\"resource\":\"qn\",\"operation\":\"poczvyifqrvkdvjs\",\"description\":\"lrmv\"}}]}"; - - 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(Context.NONE); - - Assertions.assertEquals("ksymd", response.iterator().next().name()); - } -} 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 1edc51ef3d9ff..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuCapabilityTests.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.SkuCapability; -import org.junit.jupiter.api.Test; - -public final class SkuCapabilityTests { - @Test - public void testDeserialize() { - SkuCapability model = - BinaryData - .fromString("{\"name\":\"cputegjvwmfdats\",\"value\":\"dvpjhulsuuvmk\"}") - .toObject(SkuCapability.class); - } - - @Test - public void testSerialize() { - 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 0aeb67774a2c9..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationInnerTests.java +++ /dev/null @@ -1,33 +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; -import org.junit.jupiter.api.Test; - -public final class SkuInformationInnerTests { - @Test - public void testDeserialize() { - SkuInformationInner model = - BinaryData - .fromString( - "{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\",\"resourceType\":\"ihfxtijbpzvgnwzs\",\"locations\":[\"lzufcyzkohdbi\",\"anufhfcbjysag\"],\"locationInfo\":[{\"location\":\"qhabifpikxwcz\",\"zones\":[\"cnpqxuhivyqniwby\",\"rkxvdum\",\"grtfwvu\"]}],\"capabilities\":[{\"name\":\"udccsnhsjc\",\"value\":\"ejhkry\"},{\"name\":\"napczwlokjy\",\"value\":\"kkvnipjox\"}]}") - .toObject(SkuInformationInner.class); - Assertions.assertEquals(SkuName.PREMIUM_ZRS, model.name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.tier()); - } - - @Test - public void testSerialize() { - 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 bc544aaa1a5c8..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuInformationListTests.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.models.SkuInformationList; -import org.junit.jupiter.api.Test; - -public final class SkuInformationListTests { - @Test - public void testDeserialize() { - SkuInformationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"Premium_ZRS\",\"tier\":\"Premium\",\"resourceType\":\"ofcqhsm\",\"locations\":[\"kdtmlxhekuk\",\"jtxukcdm\"],\"locationInfo\":[],\"capabilities\":[]},{\"name\":\"Premium_LRS\",\"tier\":\"Premium\",\"resourceType\":\"zwuxzd\",\"locations\":[\"yrlhmwhfpmrqobm\"],\"locationInfo\":[],\"capabilities\":[]}]}") - .toObject(SkuInformationList.class); - } - - @Test - public void testSerialize() { - 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 79567fb60902d..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuLocationInfoTests.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.SkuLocationInfo; -import org.junit.jupiter.api.Test; - -public final class SkuLocationInfoTests { - @Test - public void testDeserialize() { - SkuLocationInfo model = - BinaryData - .fromString("{\"location\":\"nchgej\",\"zones\":[\"dmailzydehojw\",\"ahuxinpm\",\"njaqwixjspro\"]}") - .toObject(SkuLocationInfo.class); - } - - @Test - public void testSerialize() { - 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 35e2b01efd79f..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkuTests.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.Sku; -import com.azure.resourcemanager.elasticsan.models.SkuName; -import com.azure.resourcemanager.elasticsan.models.SkuTier; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SkuTests { - @Test - public void testDeserialize() { - 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()); - } - - @Test - public void testSerialize() { - 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 fe6b70f6989b5..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SkusListMockTests.java +++ /dev/null @@ -1,71 +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.core.util.Context; -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\":\"pnpulexxbczwtru\",\"locations\":[\"zb\",\"j\",\"sovmyokacspkwl\"],\"locationInfo\":[{\"location\":\"bpxjmfl\",\"zones\":[\"nchrkcciww\",\"juqk\",\"rsa\"]},{\"location\":\"wkuofoskghsauu\",\"zones\":[\"mvxi\",\"duugidyjr\"]},{\"location\":\"byao\",\"zones\":[\"xc\"]},{\"location\":\"npc\",\"zones\":[\"cohslkev\",\"eggzfb\",\"hfmvfaxkffe\"]}],\"capabilities\":[{\"name\":\"lvmezyvshxmzsbbz\",\"value\":\"gigr\"}]}]}"; - - 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("d", 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 c8fd2a9228ac8..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/SourceCreationDataTests.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.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SourceCreationDataTests { - @Test - public void testDeserialize() { - SourceCreationData model = - BinaryData - .fromString("{\"createSource\":\"None\",\"sourceUri\":\"lokeyy\"}") - .toObject(SourceCreationData.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.createSource()); - Assertions.assertEquals("lokeyy", model.sourceUri()); - } - - @Test - public void testSerialize() { - SourceCreationData model = - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("lokeyy"); - model = BinaryData.fromObject(model).toObject(SourceCreationData.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.createSource()); - Assertions.assertEquals("lokeyy", 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 12093ddf1201c..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VirtualNetworkRuleTests.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.models.Action; -import com.azure.resourcemanager.elasticsan.models.VirtualNetworkRule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VirtualNetworkRuleTests { - @Test - public void testDeserialize() { - VirtualNetworkRule model = - BinaryData - .fromString("{\"id\":\"vhkhixu\",\"action\":\"Allow\",\"state\":\"deprovisioning\"}") - .toObject(VirtualNetworkRule.class); - Assertions.assertEquals("vhkhixu", model.virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.action()); - } - - @Test - public void testSerialize() { - VirtualNetworkRule model = - new VirtualNetworkRule().withVirtualNetworkResourceId("vhkhixu").withAction(Action.ALLOW); - model = BinaryData.fromObject(model).toObject(VirtualNetworkRule.class); - Assertions.assertEquals("vhkhixu", 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 c072175be164e..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupInnerTests.java +++ /dev/null @@ -1,55 +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 java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeGroupInnerTests { - @Test - public void testDeserialize() { - VolumeGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Invalid\",\"protocolType\":\"Iscsi\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[]}},\"tags\":{\"scpai\":\"zloc\",\"l\":\"rhhbcs\",\"bnbdxkqpxokajion\":\"mmajtjaodx\"},\"id\":\"imexgstxgcpodgma\",\"name\":\"jrmvdjwzrlo\",\"type\":\"mcl\"}") - .toObject(VolumeGroupInner.class); - Assertions.assertEquals("zloc", model.tags().get("scpai")); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - } - - @Test - public void testSerialize() { - VolumeGroupInner model = - new VolumeGroupInner() - .withTags(mapOf("scpai", "zloc", "l", "rhhbcs", "bnbdxkqpxokajion", "mmajtjaodx")) - .withProtocolType(StorageTargetType.ISCSI) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls(new NetworkRuleSet().withVirtualNetworkRules(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(VolumeGroupInner.class); - Assertions.assertEquals("zloc", model.tags().get("scpai")); - Assertions.assertEquals(StorageTargetType.ISCSI, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - } - - @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/VolumeGroupListTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupListTests.java deleted file mode 100644 index a57295cc3444d..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupListTests.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.util.BinaryData; -import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner; -import com.azure.resourcemanager.elasticsan.models.EncryptionType; -import com.azure.resourcemanager.elasticsan.models.StorageTargetType; -import com.azure.resourcemanager.elasticsan.models.VolumeGroupList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeGroupListTests { - @Test - public void testDeserialize() { - VolumeGroupList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Pending\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\"},\"tags\":{\"jaoyfhrtx\":\"igjyjg\",\"fqawrlyxw\":\"lnerkujysvleju\",\"xgjvtbv\":\"kcprbnw\",\"uouq\":\"ysszdnrujqguh\"},\"id\":\"prwzwbnguitnwui\",\"name\":\"gazxuf\",\"type\":\"zuckyfi\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\"},\"tags\":{\"sdkf\":\"htymw\"},\"id\":\"hwxmnteiwa\",\"name\":\"pvkmijcmmxdcuf\",\"type\":\"fsrpymzidnse\"},{\"properties\":{\"provisioningState\":\"Pending\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\"},\"tags\":{\"mdwzjeiachboo\":\"sne\"},\"id\":\"flnrosfqpteehzz\",\"name\":\"ypyqrimzinp\",\"type\":\"swjdkirso\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\"},\"tags\":{\"kwh\":\"t\",\"gr\":\"soifiyipjxsqw\",\"qabnmoc\":\"bznorcjxvsnby\"},\"id\":\"cyshurzafbljjgp\",\"name\":\"toqcjmklja\",\"type\":\"bqidtqaj\"}],\"nextLink\":\"ulpkudjkrl\"}") - .toObject(VolumeGroupList.class); - Assertions.assertEquals("igjyjg", model.value().get(0).tags().get("jaoyfhrtx")); - Assertions.assertEquals(StorageTargetType.NONE, model.value().get(0).protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.value().get(0).encryption()); - } - - @Test - public void testSerialize() { - VolumeGroupList model = - new VolumeGroupList() - .withValue( - Arrays - .asList( - new VolumeGroupInner() - .withTags( - mapOf( - "jaoyfhrtx", - "igjyjg", - "fqawrlyxw", - "lnerkujysvleju", - "xgjvtbv", - "kcprbnw", - "uouq", - "ysszdnrujqguh")) - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY), - new VolumeGroupInner() - .withTags(mapOf("sdkf", "htymw")) - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY), - new VolumeGroupInner() - .withTags(mapOf("mdwzjeiachboo", "sne")) - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY), - new VolumeGroupInner() - .withTags(mapOf("kwh", "t", "gr", "soifiyipjxsqw", "qabnmoc", "bznorcjxvsnby")) - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY))); - model = BinaryData.fromObject(model).toObject(VolumeGroupList.class); - Assertions.assertEquals("igjyjg", model.value().get(0).tags().get("jaoyfhrtx")); - Assertions.assertEquals(StorageTargetType.NONE, model.value().get(0).protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.value().get(0).encryption()); - } - - @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/VolumeGroupPropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupPropertiesTests.java deleted file mode 100644 index 0205b84c1fae5..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupPropertiesTests.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.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; -import org.junit.jupiter.api.Test; - -public final class VolumeGroupPropertiesTests { - @Test - public void testDeserialize() { - VolumeGroupProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Pending\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"bzaqsqsycbkbfk\",\"action\":\"Allow\",\"state\":\"networkSourceDeleted\"},{\"id\":\"exxppofmxaxcfjp\",\"action\":\"Allow\",\"state\":\"failed\"},{\"id\":\"c\",\"action\":\"Allow\",\"state\":\"failed\"},{\"id\":\"pmouexhdz\",\"action\":\"Allow\",\"state\":\"failed\"}]}}") - .toObject(VolumeGroupProperties.class); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions - .assertEquals( - "bzaqsqsycbkbfk", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } - - @Test - public void testSerialize() { - VolumeGroupProperties model = - new VolumeGroupProperties() - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("bzaqsqsycbkbfk") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("exxppofmxaxcfjp") - .withAction(Action.ALLOW), - new VirtualNetworkRule().withVirtualNetworkResourceId("c").withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("pmouexhdz") - .withAction(Action.ALLOW)))); - model = BinaryData.fromObject(model).toObject(VolumeGroupProperties.class); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions - .assertEquals( - "bzaqsqsycbkbfk", 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 5d5b938c60d40..0000000000000 --- 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; -import org.junit.jupiter.api.Test; - -public final class VolumeGroupUpdatePropertiesTests { - @Test - public void testDeserialize() { - VolumeGroupUpdateProperties model = - BinaryData - .fromString( - "{\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[{\"id\":\"vvtpgvdfgio\",\"action\":\"Allow\",\"state\":\"failed\"},{\"id\":\"tqxln\",\"action\":\"Allow\",\"state\":\"deprovisioning\"},{\"id\":\"gug\",\"action\":\"Allow\",\"state\":\"provisioning\"}]}}") - .toObject(VolumeGroupUpdateProperties.class); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions - .assertEquals("vvtpgvdfgio", model.networkAcls().virtualNetworkRules().get(0).virtualNetworkResourceId()); - Assertions.assertEquals(Action.ALLOW, model.networkAcls().virtualNetworkRules().get(0).action()); - } - - @Test - public void testSerialize() { - VolumeGroupUpdateProperties model = - new VolumeGroupUpdateProperties() - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls( - new NetworkRuleSet() - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withVirtualNetworkResourceId("vvtpgvdfgio") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("tqxln") - .withAction(Action.ALLOW), - new VirtualNetworkRule() - .withVirtualNetworkResourceId("gug") - .withAction(Action.ALLOW)))); - model = BinaryData.fromObject(model).toObject(VolumeGroupUpdateProperties.class); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - Assertions - .assertEquals("vvtpgvdfgio", 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 a8ffcc4900ddb..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupUpdateTests.java +++ /dev/null @@ -1,55 +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.EncryptionType; -import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; -import com.azure.resourcemanager.elasticsan.models.StorageTargetType; -import com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeGroupUpdateTests { - @Test - public void testDeserialize() { - VolumeGroupUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[]}},\"tags\":{\"a\":\"w\"}}") - .toObject(VolumeGroupUpdate.class); - Assertions.assertEquals("w", model.tags().get("a")); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - } - - @Test - public void testSerialize() { - VolumeGroupUpdate model = - new VolumeGroupUpdate() - .withTags(mapOf("a", "w")) - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls(new NetworkRuleSet().withVirtualNetworkRules(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(VolumeGroupUpdate.class); - Assertions.assertEquals("w", model.tags().get("a")); - Assertions.assertEquals(StorageTargetType.NONE, model.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, model.encryption()); - } - - @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/VolumeGroupsCreateMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateMockTests.java deleted file mode 100644 index 25377334adabc..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsCreateMockTests.java +++ /dev/null @@ -1,94 +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.EncryptionType; -import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet; -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 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 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\":[]}},\"tags\":{\"nxdhbt\":\"k\"},\"id\":\"kphywpnvjto\",\"name\":\"nermcl\",\"type\":\"plpho\"}"; - - 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("txp") - .withExistingElasticSan("kdwzbaiuebbaumny", "upedeojnabckhs") - .withTags(mapOf("htldwk", "skrdqmhjj", "otogtwrupqs", "zxuutkncwscwsvl")) - .withProtocolType(StorageTargetType.NONE) - .withEncryption(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY) - .withNetworkAcls(new NetworkRuleSet().withVirtualNetworkRules(Arrays.asList())) - .create(); - - Assertions.assertEquals("k", response.tags().get("nxdhbt")); - Assertions.assertEquals(StorageTargetType.NONE, response.protocolType()); - Assertions.assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, response.encryption()); - } - - @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/VolumeGroupsDeleteMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteMockTests.java deleted file mode 100644 index 8e1890c477108..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsDeleteMockTests.java +++ /dev/null @@ -1,62 +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.core.util.Context; -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("mg", "xnkjzkdesl", "vlopwiyighx", Context.NONE); - } -} 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 f10244a9a61fa..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeGroupsListByElasticSanMockTests.java +++ /dev/null @@ -1,74 +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.core.util.Context; -import com.azure.resourcemanager.elasticsan.ElasticSanManager; -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\":\"Creating\",\"protocolType\":\"None\",\"encryption\":\"EncryptionAtRestWithPlatformKey\",\"networkAcls\":{\"virtualNetworkRules\":[]}},\"tags\":{\"xytxhpzxbz\":\"jswztsdbpg\",\"lcuhxwtctyqiklb\":\"fzab\",\"bhvgy\":\"ovplw\"},\"id\":\"gu\",\"name\":\"svmkfssxquk\",\"type\":\"fpl\"}]}"; - - 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("zyoxaepdkzjan", "ux", Context.NONE); - - Assertions.assertEquals("jswztsdbpg", response.iterator().next().tags().get("xytxhpzxbz")); - Assertions.assertEquals(StorageTargetType.NONE, response.iterator().next().protocolType()); - Assertions - .assertEquals(EncryptionType.ENCRYPTION_AT_REST_WITH_PLATFORM_KEY, response.iterator().next().encryption()); - } -} 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 64221d9e0550e..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeInnerTests.java +++ /dev/null @@ -1,55 +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 java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeInnerTests { - @Test - public void testDeserialize() { - VolumeInner model = - BinaryData - .fromString( - "{\"properties\":{\"volumeId\":\"mi\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"rvqdra\"},\"sizeGiB\":6644182027847311754,\"storageTarget\":{\"targetIqn\":\"gehoqfbowskany\",\"targetPortalHostname\":\"zlcuiywgqywgndrv\",\"targetPortalPort\":2138839355,\"provisioningState\":\"Pending\",\"status\":\"Updating\"}},\"tags\":{\"ofsx\":\"gyncocpecfvmmc\",\"qjqabcypmivkwl\":\"zevgb\",\"wnfnbacf\":\"uvcc\"},\"id\":\"onlebxetqgtzxdpn\",\"name\":\"bqqwxrj\",\"type\":\"eallnwsubisnj\"}") - .toObject(VolumeInner.class); - Assertions.assertEquals("gyncocpecfvmmc", model.tags().get("ofsx")); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("rvqdra", model.creationData().sourceUri()); - Assertions.assertEquals(6644182027847311754L, model.sizeGiB()); - } - - @Test - public void testSerialize() { - VolumeInner model = - new VolumeInner() - .withTags(mapOf("ofsx", "gyncocpecfvmmc", "qjqabcypmivkwl", "zevgb", "wnfnbacf", "uvcc")) - .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("rvqdra")) - .withSizeGiB(6644182027847311754L); - model = BinaryData.fromObject(model).toObject(VolumeInner.class); - Assertions.assertEquals("gyncocpecfvmmc", model.tags().get("ofsx")); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("rvqdra", model.creationData().sourceUri()); - Assertions.assertEquals(6644182027847311754L, model.sizeGiB()); - } - - @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/VolumeListTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeListTests.java deleted file mode 100644 index 1a983dc1bdfe3..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeListTests.java +++ /dev/null @@ -1,66 +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.VolumeList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeListTests { - @Test - public void testDeserialize() { - VolumeList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"volumeId\":\"wdslfhotwmcy\",\"sizeGiB\":7443640931865034302},\"tags\":{\"ehxnltyfsop\":\"acfta\",\"nzwdejba\":\"usue\",\"xdn\":\"orxzdmohctbqvud\"},\"id\":\"nvowgujju\",\"name\":\"wdkcglhsl\",\"type\":\"zj\"},{\"properties\":{\"volumeId\":\"gdtjixhbkuofqwey\",\"sizeGiB\":7762769610748668832},\"tags\":{\"cibvyvdcsitynn\":\"exfwhy\",\"f\":\"amdecte\"},\"id\":\"qsc\",\"name\":\"eypvhezrkg\",\"type\":\"hcjrefovgmk\"},{\"properties\":{\"volumeId\":\"eyyvxyqjpkcat\",\"sizeGiB\":6006698533954960409},\"tags\":{\"ounqecano\":\"zsqpjhvmdajvny\",\"pjmcmatuokthfuiu\":\"eupfhyhltrpm\",\"zydagfuaxbezyiuo\":\"odsfcpkvxodpuozm\"},\"id\":\"ktwh\",\"name\":\"dxwzywqsmbsurexi\",\"type\":\"o\"}],\"nextLink\":\"ocfs\"}") - .toObject(VolumeList.class); - Assertions.assertEquals("acfta", model.value().get(0).tags().get("ehxnltyfsop")); - Assertions.assertEquals(7443640931865034302L, model.value().get(0).sizeGiB()); - } - - @Test - public void testSerialize() { - VolumeList model = - new VolumeList() - .withValue( - Arrays - .asList( - new VolumeInner() - .withTags(mapOf("ehxnltyfsop", "acfta", "nzwdejba", "usue", "xdn", "orxzdmohctbqvud")) - .withSizeGiB(7443640931865034302L), - new VolumeInner() - .withTags(mapOf("cibvyvdcsitynn", "exfwhy", "f", "amdecte")) - .withSizeGiB(7762769610748668832L), - new VolumeInner() - .withTags( - mapOf( - "ounqecano", - "zsqpjhvmdajvny", - "pjmcmatuokthfuiu", - "eupfhyhltrpm", - "zydagfuaxbezyiuo", - "odsfcpkvxodpuozm")) - .withSizeGiB(6006698533954960409L))); - model = BinaryData.fromObject(model).toObject(VolumeList.class); - Assertions.assertEquals("acfta", model.value().get(0).tags().get("ehxnltyfsop")); - Assertions.assertEquals(7443640931865034302L, model.value().get(0).sizeGiB()); - } - - @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/VolumePropertiesTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumePropertiesTests.java deleted file mode 100644 index 81e4071eece99..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumePropertiesTests.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.VolumeProperties; -import com.azure.resourcemanager.elasticsan.models.SourceCreationData; -import com.azure.resourcemanager.elasticsan.models.VolumeCreateOption; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumePropertiesTests { - @Test - public void testDeserialize() { - VolumeProperties model = - BinaryData - .fromString( - "{\"volumeId\":\"pmng\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"aqw\"},\"sizeGiB\":8694303623294898689,\"storageTarget\":{\"targetIqn\":\"onq\",\"targetPortalHostname\":\"kvlrxnj\",\"targetPortalPort\":1486121572,\"provisioningState\":\"Deleting\",\"status\":\"Stopped" - + " (deallocated)\"}}") - .toObject(VolumeProperties.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("aqw", model.creationData().sourceUri()); - Assertions.assertEquals(8694303623294898689L, model.sizeGiB()); - } - - @Test - public void testSerialize() { - VolumeProperties model = - new VolumeProperties() - .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("aqw")) - .withSizeGiB(8694303623294898689L); - model = BinaryData.fromObject(model).toObject(VolumeProperties.class); - Assertions.assertEquals(VolumeCreateOption.NONE, model.creationData().createSource()); - Assertions.assertEquals("aqw", model.creationData().sourceUri()); - Assertions.assertEquals(8694303623294898689L, 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 583e9d8f7eb06..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdatePropertiesTests.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.VolumeUpdateProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeUpdatePropertiesTests { - @Test - public void testDeserialize() { - VolumeUpdateProperties model = - BinaryData.fromString("{\"sizeGiB\":246259275856309822}").toObject(VolumeUpdateProperties.class); - Assertions.assertEquals(246259275856309822L, model.sizeGiB()); - } - - @Test - public void testSerialize() { - VolumeUpdateProperties model = new VolumeUpdateProperties().withSizeGiB(246259275856309822L); - model = BinaryData.fromObject(model).toObject(VolumeUpdateProperties.class); - Assertions.assertEquals(246259275856309822L, 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 5c57224bd87e6..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumeUpdateTests.java +++ /dev/null @@ -1,43 +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 java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeUpdateTests { - @Test - public void testDeserialize() { - VolumeUpdate model = - BinaryData - .fromString("{\"properties\":{\"sizeGiB\":7219276068713621515},\"tags\":{\"ualhbxxhejj\":\"e\"}}") - .toObject(VolumeUpdate.class); - Assertions.assertEquals("e", model.tags().get("ualhbxxhejj")); - Assertions.assertEquals(7219276068713621515L, model.sizeGiB()); - } - - @Test - public void testSerialize() { - VolumeUpdate model = new VolumeUpdate().withTags(mapOf("ualhbxxhejj", "e")).withSizeGiB(7219276068713621515L); - model = BinaryData.fromObject(model).toObject(VolumeUpdate.class); - Assertions.assertEquals("e", model.tags().get("ualhbxxhejj")); - Assertions.assertEquals(7219276068713621515L, model.sizeGiB()); - } - - @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/VolumesCreateMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateMockTests.java deleted file mode 100644 index bea94e513881e..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesCreateMockTests.java +++ /dev/null @@ -1,93 +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 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 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\":\"tdhxujznbmpowuwp\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"eualupjmkhf\"},\"sizeGiB\":3301190446287542210,\"storageTarget\":{\"targetIqn\":\"wsrtjriplrbpbe\",\"targetPortalHostname\":\"ghfg\",\"targetPortalPort\":107282315,\"provisioningState\":\"Creating\",\"status\":\"Stopped\"}},\"tags\":{\"egibtnmxiebww\":\"qhjk\"},\"id\":\"loayqcgw\",\"name\":\"tzjuzgwyzmhtxo\",\"type\":\"gmtsavjcbpwxqpsr\"}"; - - 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("bnbbeldawkz") - .withExistingVolumegroup("rcrgvx", "vgomz", "fmisg") - .withTags(mapOf("wjue", "uojgj", "x", "otwmcdyt", "nrjawgqwg", "it")) - .withCreationData( - new SourceCreationData().withCreateSource(VolumeCreateOption.NONE).withSourceUri("kauhashsfwxo")) - .withSizeGiB(499852451661669688L) - .create(); - - Assertions.assertEquals("qhjk", response.tags().get("egibtnmxiebww")); - Assertions.assertEquals(VolumeCreateOption.NONE, response.creationData().createSource()); - Assertions.assertEquals("eualupjmkhf", response.creationData().sourceUri()); - Assertions.assertEquals(3301190446287542210L, response.sizeGiB()); - } - - @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/VolumesDeleteMockTests.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteMockTests.java deleted file mode 100644 index 151f9e0daddc9..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesDeleteMockTests.java +++ /dev/null @@ -1,62 +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.core.util.Context; -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("uscrpabgyepsb", "tazqugxywpmueefj", "wfqkquj", "dsuyonobgla", Context.NONE); - } -} 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 4a5a1c9185bb7..0000000000000 --- a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/test/java/com/azure/resourcemanager/elasticsan/generated/VolumesListByVolumeGroupMockTests.java +++ /dev/null @@ -1,72 +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.core.util.Context; -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\":\"xy\",\"creationData\":{\"createSource\":\"None\",\"sourceUri\":\"rxv\"},\"sizeGiB\":328428173774055677,\"storageTarget\":{\"targetIqn\":\"zntxhdz\",\"targetPortalHostname\":\"rqjbhckfrl\",\"targetPortalPort\":367303674,\"provisioningState\":\"Failed\",\"status\":\"Stopped\"}},\"tags\":{\"uzbpzkafku\":\"ca\",\"rnwb\":\"b\",\"hspkdeemao\":\"ehhseyvjusrts\",\"gkvtmelmqkrhah\":\"mx\"},\"id\":\"ljuahaquhcdh\",\"name\":\"duala\",\"type\":\"xqpvfadmw\"}]}"; - - 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("cq", "tcc", "g", Context.NONE); - - Assertions.assertEquals("ca", response.iterator().next().tags().get("uzbpzkafku")); - Assertions.assertEquals(VolumeCreateOption.NONE, response.iterator().next().creationData().createSource()); - Assertions.assertEquals("rxv", response.iterator().next().creationData().sourceUri()); - Assertions.assertEquals(328428173774055677L, response.iterator().next().sizeGiB()); - } -}