scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval =
+ Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of ElasticSan service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the ElasticSan service API instance.
+ */
+ public ElasticSanManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.elasticsan")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new ElasticSanManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * Gets the resource collection API of Skus.
+ *
+ * @return Resource collection API of Skus.
+ */
+ public Skus skus() {
+ if (this.skus == null) {
+ this.skus = new SkusImpl(clientObject.getSkus(), this);
+ }
+ return skus;
+ }
+
+ /**
+ * Gets the resource collection API of ElasticSans. It manages ElasticSan.
+ *
+ * @return Resource collection API of ElasticSans.
+ */
+ public ElasticSans elasticSans() {
+ if (this.elasticSans == null) {
+ this.elasticSans = new ElasticSansImpl(clientObject.getElasticSans(), this);
+ }
+ return elasticSans;
+ }
+
+ /**
+ * Gets the resource collection API of VolumeGroups. It manages VolumeGroup.
+ *
+ * @return Resource collection API of VolumeGroups.
+ */
+ public VolumeGroups volumeGroups() {
+ if (this.volumeGroups == null) {
+ this.volumeGroups = new VolumeGroupsImpl(clientObject.getVolumeGroups(), this);
+ }
+ return volumeGroups;
+ }
+
+ /**
+ * Gets the resource collection API of Volumes. It manages Volume.
+ *
+ * @return Resource collection API of Volumes.
+ */
+ public Volumes volumes() {
+ if (this.volumes == null) {
+ this.volumes = new VolumesImpl(clientObject.getVolumes(), this);
+ }
+ return volumes;
+ }
+
+ /**
+ * @return Wrapped service client ElasticSanManagement providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public ElasticSanManagement serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java
new file mode 100644
index 0000000000000..2d251f2bd9129
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSanManagement.java
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for ElasticSanManagement class. */
+public interface ElasticSanManagement {
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the SkusClient object to access its operations.
+ *
+ * @return the SkusClient object.
+ */
+ SkusClient getSkus();
+
+ /**
+ * Gets the ElasticSansClient object to access its operations.
+ *
+ * @return the ElasticSansClient object.
+ */
+ ElasticSansClient getElasticSans();
+
+ /**
+ * Gets the VolumeGroupsClient object to access its operations.
+ *
+ * @return the VolumeGroupsClient object.
+ */
+ VolumeGroupsClient getVolumeGroups();
+
+ /**
+ * Gets the VolumesClient object to access its operations.
+ *
+ * @return the VolumesClient object.
+ */
+ VolumesClient getVolumes();
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java
new file mode 100644
index 0000000000000..952ea81cc9094
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/ElasticSansClient.java
@@ -0,0 +1,267 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate;
+
+/** An instance of this class provides access to all the operations defined in ElasticSansClient. */
+public interface ElasticSansClient {
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ElasticSanInner> beginCreate(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters);
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ElasticSanInner> beginCreate(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context);
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ElasticSanInner create(String resourceGroupName, String elasticSanName, ElasticSanInner parameters);
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ElasticSanInner create(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context);
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ElasticSanInner> beginUpdate(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters);
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ElasticSanInner> beginUpdate(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context);
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ElasticSanInner update(String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters);
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ElasticSanInner update(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context);
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown 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);
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown 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, Context context);
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String elasticSanName);
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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, Context context);
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ElasticSanInner getByResourceGroup(String resourceGroupName, String elasticSanName);
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String elasticSanName, Context context);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..d58c5fd9796fe
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/OperationsClient.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.java
new file mode 100644
index 0000000000000..fd4fe1bed370f
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/SkusClient.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner;
+
+/** An instance of this class provides access to all the operations defined in SkusClient. */
+public interface SkusClient {
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @param filter Specify $filter='location eq <location>' to filter on location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String filter, Context context);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java
new file mode 100644
index 0000000000000..41bbe20fc8281
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumeGroupsClient.java
@@ -0,0 +1,281 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.elasticsan.fluent.models.VolumeGroupInner;
+import com.azure.resourcemanager.elasticsan.models.VolumeGroupUpdate;
+
+/** An instance of this class provides access to all the operations defined in VolumeGroupsClient. */
+public interface VolumeGroupsClient {
+ /**
+ * List VolumeGroups.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Volume Groups as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName);
+
+ /**
+ * List VolumeGroups.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Volume Groups as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByElasticSan(String resourceGroupName, String elasticSanName, Context context);
+
+ /**
+ * Create a Volume Group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeGroupInner> beginCreate(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters);
+
+ /**
+ * Create a Volume Group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeGroupInner> beginCreate(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ VolumeGroupInner parameters,
+ Context context);
+
+ /**
+ * Create a Volume Group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeGroupInner create(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupInner parameters);
+
+ /**
+ * Create a Volume Group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeGroupInner create(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ VolumeGroupInner parameters,
+ Context context);
+
+ /**
+ * Update an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeGroupInner> beginUpdate(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters);
+
+ /**
+ * Update an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeGroupInner> beginUpdate(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ VolumeGroupUpdate parameters,
+ Context context);
+
+ /**
+ * Update an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeGroupInner update(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, VolumeGroupUpdate parameters);
+
+ /**
+ * Update an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param parameters Volume Group object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume Group request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeGroupInner update(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ VolumeGroupUpdate parameters,
+ Context context);
+
+ /**
+ * Delete an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String elasticSanName, String volumeGroupName);
+
+ /**
+ * Delete an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, Context context);
+
+ /**
+ * Delete an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String elasticSanName, String volumeGroupName);
+
+ /**
+ * Delete an VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, Context context);
+
+ /**
+ * Get an VolumeGroups.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an VolumeGroups.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeGroupInner get(String resourceGroupName, String elasticSanName, String volumeGroupName);
+
+ /**
+ * Get an VolumeGroups.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an VolumeGroups along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, Context context);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java
new file mode 100644
index 0000000000000..32fb71b55b122
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/VolumesClient.java
@@ -0,0 +1,320 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.elasticsan.fluent.models.VolumeInner;
+import com.azure.resourcemanager.elasticsan.models.VolumeUpdate;
+
+/** An instance of this class provides access to all the operations defined in VolumesClient. */
+public interface VolumesClient {
+ /**
+ * Create a Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeInner> beginCreate(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeInner parameters);
+
+ /**
+ * Create a Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeInner> beginCreate(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeInner parameters,
+ Context context);
+
+ /**
+ * Create a Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeInner create(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeInner parameters);
+
+ /**
+ * Create a Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeInner create(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeInner parameters,
+ Context context);
+
+ /**
+ * Update an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeInner> beginUpdate(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeUpdate parameters);
+
+ /**
+ * Update an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, VolumeInner> beginUpdate(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeUpdate parameters,
+ Context context);
+
+ /**
+ * Update an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeInner update(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeUpdate parameters);
+
+ /**
+ * Update an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param parameters Volume object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Volume request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeInner update(
+ String resourceGroupName,
+ String elasticSanName,
+ String volumeGroupName,
+ String volumeName,
+ VolumeUpdate parameters,
+ Context context);
+
+ /**
+ * Delete an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName);
+
+ /**
+ * Delete an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context);
+
+ /**
+ * Delete an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName);
+
+ /**
+ * Delete an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context);
+
+ /**
+ * Get an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Volume.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ VolumeInner get(String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName);
+
+ /**
+ * Get an Volume.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param volumeName The name of the Volume.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return an Volume along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, String volumeName, Context context);
+
+ /**
+ * List Volumes in a VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Volumes as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByVolumeGroup(
+ String resourceGroupName, String elasticSanName, String volumeGroupName);
+
+ /**
+ * List Volumes in a VolumeGroup.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param volumeGroupName The name of the VolumeGroup.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Volumes as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByVolumeGroup(
+ String resourceGroupName, String elasticSanName, String volumeGroupName, Context context);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java
new file mode 100644
index 0000000000000..1e3cd58b23061
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanInner.java
@@ -0,0 +1,219 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.elasticsan.models.ProvisioningStates;
+import com.azure.resourcemanager.elasticsan.models.Sku;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** Response for ElasticSan request. */
+@Fluent
+public final class ElasticSanInner extends Resource {
+ /*
+ * Properties of ElasticSan.
+ */
+ @JsonProperty(value = "properties")
+ private ElasticSanProperties innerProperties;
+
+ /*
+ * Resource metadata required by ARM RPC
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /**
+ * Get the innerProperties property: Properties of ElasticSan.
+ *
+ * @return the innerProperties value.
+ */
+ private ElasticSanProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Resource metadata required by ARM RPC.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ElasticSanInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ElasticSanInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the sku property: resource sku.
+ *
+ * @return the sku value.
+ */
+ public Sku sku() {
+ return this.innerProperties() == null ? null : this.innerProperties().sku();
+ }
+
+ /**
+ * Set the sku property: resource sku.
+ *
+ * @param sku the sku value to set.
+ * @return the ElasticSanInner object itself.
+ */
+ public ElasticSanInner withSku(Sku sku) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ElasticSanProperties();
+ }
+ this.innerProperties().withSku(sku);
+ return this;
+ }
+
+ /**
+ * Get the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].
+ *
+ * @return the availabilityZones value.
+ */
+ public List availabilityZones() {
+ return this.innerProperties() == null ? null : this.innerProperties().availabilityZones();
+ }
+
+ /**
+ * Set the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].
+ *
+ * @param availabilityZones the availabilityZones value to set.
+ * @return the ElasticSanInner object itself.
+ */
+ public ElasticSanInner withAvailabilityZones(List availabilityZones) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ElasticSanProperties();
+ }
+ this.innerProperties().withAvailabilityZones(availabilityZones);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: State of the operation on the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningStates provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
+ *
+ * @return the baseSizeTiB value.
+ */
+ public Long baseSizeTiB() {
+ return this.innerProperties() == null ? null : this.innerProperties().baseSizeTiB();
+ }
+
+ /**
+ * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
+ *
+ * @param baseSizeTiB the baseSizeTiB value to set.
+ * @return the ElasticSanInner object itself.
+ */
+ public ElasticSanInner withBaseSizeTiB(Long baseSizeTiB) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ElasticSanProperties();
+ }
+ this.innerProperties().withBaseSizeTiB(baseSizeTiB);
+ return this;
+ }
+
+ /**
+ * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
+ *
+ * @return the extendedCapacitySizeTiB value.
+ */
+ public Long extendedCapacitySizeTiB() {
+ return this.innerProperties() == null ? null : this.innerProperties().extendedCapacitySizeTiB();
+ }
+
+ /**
+ * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
+ *
+ * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set.
+ * @return the ElasticSanInner object itself.
+ */
+ public ElasticSanInner withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ElasticSanProperties();
+ }
+ this.innerProperties().withExtendedCapacitySizeTiB(extendedCapacitySizeTiB);
+ return this;
+ }
+
+ /**
+ * Get the totalVolumeSizeGiB property: Total size of the provisioned Volumes in GiB.
+ *
+ * @return the totalVolumeSizeGiB value.
+ */
+ public Long totalVolumeSizeGiB() {
+ return this.innerProperties() == null ? null : this.innerProperties().totalVolumeSizeGiB();
+ }
+
+ /**
+ * Get the volumeGroupCount property: Total number of volume groups in this Elastic San appliance.
+ *
+ * @return the volumeGroupCount value.
+ */
+ public Long volumeGroupCount() {
+ return this.innerProperties() == null ? null : this.innerProperties().volumeGroupCount();
+ }
+
+ /**
+ * Get the totalIops property: Total Provisioned IOPS of the Elastic San appliance.
+ *
+ * @return the totalIops value.
+ */
+ public Long totalIops() {
+ return this.innerProperties() == null ? null : this.innerProperties().totalIops();
+ }
+
+ /**
+ * Get the totalMBps property: Total Provisioned MBps Elastic San appliance.
+ *
+ * @return the totalMBps value.
+ */
+ public Long totalMBps() {
+ return this.innerProperties() == null ? null : this.innerProperties().totalMBps();
+ }
+
+ /**
+ * Get the totalSizeTiB property: Total size of the Elastic San appliance in TB.
+ *
+ * @return the totalSizeTiB value.
+ */
+ public Long totalSizeTiB() {
+ return this.innerProperties() == null ? null : this.innerProperties().totalSizeTiB();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java
new file mode 100644
index 0000000000000..05d6f55cada3d
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanProperties.java
@@ -0,0 +1,229 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.models.ProvisioningStates;
+import com.azure.resourcemanager.elasticsan.models.Sku;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Elastic San response properties. */
+@Fluent
+public final class ElasticSanProperties {
+ /*
+ * resource sku
+ */
+ @JsonProperty(value = "sku")
+ private Sku sku;
+
+ /*
+ * Logical zone for Elastic San resource; example: ["1"].
+ */
+ @JsonProperty(value = "availabilityZones", required = true)
+ private List availabilityZones;
+
+ /*
+ * State of the operation on the resource.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningStates provisioningState;
+
+ /*
+ * Base size of the Elastic San appliance in TiB.
+ */
+ @JsonProperty(value = "baseSizeTiB", required = true)
+ private long baseSizeTiB;
+
+ /*
+ * Extended size of the Elastic San appliance in TiB.
+ */
+ @JsonProperty(value = "extendedCapacitySizeTiB", required = true)
+ private long extendedCapacitySizeTiB;
+
+ /*
+ * Total size of the provisioned Volumes in GiB.
+ */
+ @JsonProperty(value = "totalVolumeSizeGiB", access = JsonProperty.Access.WRITE_ONLY)
+ private Long totalVolumeSizeGiB;
+
+ /*
+ * Total number of volume groups in this Elastic San appliance.
+ */
+ @JsonProperty(value = "volumeGroupCount", access = JsonProperty.Access.WRITE_ONLY)
+ private Long volumeGroupCount;
+
+ /*
+ * Total Provisioned IOPS of the Elastic San appliance.
+ */
+ @JsonProperty(value = "totalIops", access = JsonProperty.Access.WRITE_ONLY)
+ private Long totalIops;
+
+ /*
+ * Total Provisioned MBps Elastic San appliance.
+ */
+ @JsonProperty(value = "totalMBps", access = JsonProperty.Access.WRITE_ONLY)
+ private Long totalMBps;
+
+ /*
+ * Total size of the Elastic San appliance in TB.
+ */
+ @JsonProperty(value = "totalSizeTiB", access = JsonProperty.Access.WRITE_ONLY)
+ private Long totalSizeTiB;
+
+ /**
+ * Get the sku property: resource sku.
+ *
+ * @return the sku value.
+ */
+ public Sku sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the sku property: resource sku.
+ *
+ * @param sku the sku value to set.
+ * @return the ElasticSanProperties object itself.
+ */
+ public ElasticSanProperties withSku(Sku sku) {
+ this.sku = sku;
+ return this;
+ }
+
+ /**
+ * Get the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].
+ *
+ * @return the availabilityZones value.
+ */
+ public List availabilityZones() {
+ return this.availabilityZones;
+ }
+
+ /**
+ * Set the availabilityZones property: Logical zone for Elastic San resource; example: ["1"].
+ *
+ * @param availabilityZones the availabilityZones value to set.
+ * @return the ElasticSanProperties object itself.
+ */
+ public ElasticSanProperties withAvailabilityZones(List availabilityZones) {
+ this.availabilityZones = availabilityZones;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: State of the operation on the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningStates provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
+ *
+ * @return the baseSizeTiB value.
+ */
+ public long baseSizeTiB() {
+ return this.baseSizeTiB;
+ }
+
+ /**
+ * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
+ *
+ * @param baseSizeTiB the baseSizeTiB value to set.
+ * @return the ElasticSanProperties object itself.
+ */
+ public ElasticSanProperties withBaseSizeTiB(long baseSizeTiB) {
+ this.baseSizeTiB = baseSizeTiB;
+ return this;
+ }
+
+ /**
+ * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
+ *
+ * @return the extendedCapacitySizeTiB value.
+ */
+ public long extendedCapacitySizeTiB() {
+ return this.extendedCapacitySizeTiB;
+ }
+
+ /**
+ * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
+ *
+ * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set.
+ * @return the ElasticSanProperties object itself.
+ */
+ public ElasticSanProperties withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB) {
+ this.extendedCapacitySizeTiB = extendedCapacitySizeTiB;
+ return this;
+ }
+
+ /**
+ * Get the totalVolumeSizeGiB property: Total size of the provisioned Volumes in GiB.
+ *
+ * @return the totalVolumeSizeGiB value.
+ */
+ public Long totalVolumeSizeGiB() {
+ return this.totalVolumeSizeGiB;
+ }
+
+ /**
+ * Get the volumeGroupCount property: Total number of volume groups in this Elastic San appliance.
+ *
+ * @return the volumeGroupCount value.
+ */
+ public Long volumeGroupCount() {
+ return this.volumeGroupCount;
+ }
+
+ /**
+ * Get the totalIops property: Total Provisioned IOPS of the Elastic San appliance.
+ *
+ * @return the totalIops value.
+ */
+ public Long totalIops() {
+ return this.totalIops;
+ }
+
+ /**
+ * Get the totalMBps property: Total Provisioned MBps Elastic San appliance.
+ *
+ * @return the totalMBps value.
+ */
+ public Long totalMBps() {
+ return this.totalMBps;
+ }
+
+ /**
+ * Get the totalSizeTiB property: Total size of the Elastic San appliance in TB.
+ *
+ * @return the totalSizeTiB value.
+ */
+ public Long totalSizeTiB() {
+ return this.totalSizeTiB;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (sku() != null) {
+ sku().validate();
+ }
+ if (availabilityZones() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property availabilityZones in model ElasticSanProperties"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ElasticSanProperties.class);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java
new file mode 100644
index 0000000000000..7c19c72ab8012
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanRPOperationInner.java
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationDisplay;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Description of a ElasticSan RP Operation. */
+@Fluent
+public final class ElasticSanRPOperationInner {
+ /*
+ * The name of the operation being performed on this particular object
+ */
+ @JsonProperty(value = "name", required = true)
+ private String name;
+
+ /*
+ * Indicates whether the operation applies to data-plane.
+ */
+ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY)
+ private Boolean isDataAction;
+
+ /*
+ * Additional metadata about RP operation.
+ */
+ @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY)
+ private ElasticSanOperationDisplay display;
+
+ /**
+ * Get the name property: The name of the operation being performed on this particular object.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: The name of the operation being performed on this particular object.
+ *
+ * @param name the name value to set.
+ * @return the ElasticSanRPOperationInner object itself.
+ */
+ public ElasticSanRPOperationInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the isDataAction property: Indicates whether the operation applies to data-plane.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Additional metadata about RP operation.
+ *
+ * @return the display value.
+ */
+ public ElasticSanOperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (name() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property name in model ElasticSanRPOperationInner"));
+ }
+ if (display() != null) {
+ display().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ElasticSanRPOperationInner.class);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java
new file mode 100644
index 0000000000000..fdf989133feba
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ElasticSanUpdateProperties.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Elastic San update properties. */
+@Fluent
+public final class ElasticSanUpdateProperties {
+ /*
+ * Base size of the Elastic San appliance in TiB.
+ */
+ @JsonProperty(value = "baseSizeTiB")
+ private Long baseSizeTiB;
+
+ /*
+ * Extended size of the Elastic San appliance in TiB.
+ */
+ @JsonProperty(value = "extendedCapacitySizeTiB")
+ private Long extendedCapacitySizeTiB;
+
+ /**
+ * Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
+ *
+ * @return the baseSizeTiB value.
+ */
+ public Long baseSizeTiB() {
+ return this.baseSizeTiB;
+ }
+
+ /**
+ * Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
+ *
+ * @param baseSizeTiB the baseSizeTiB value to set.
+ * @return the ElasticSanUpdateProperties object itself.
+ */
+ public ElasticSanUpdateProperties withBaseSizeTiB(Long baseSizeTiB) {
+ this.baseSizeTiB = baseSizeTiB;
+ return this;
+ }
+
+ /**
+ * Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
+ *
+ * @return the extendedCapacitySizeTiB value.
+ */
+ public Long extendedCapacitySizeTiB() {
+ return this.extendedCapacitySizeTiB;
+ }
+
+ /**
+ * Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
+ *
+ * @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set.
+ * @return the ElasticSanUpdateProperties object itself.
+ */
+ public ElasticSanUpdateProperties withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB) {
+ this.extendedCapacitySizeTiB = extendedCapacitySizeTiB;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java
new file mode 100644
index 0000000000000..fa885e0a3522a
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/ResourceTypeSkuInner.java
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.elasticsan.models.SanTierInfo;
+import com.azure.resourcemanager.elasticsan.models.Sku;
+import com.azure.resourcemanager.elasticsan.models.SkuLocationInfo;
+import com.azure.resourcemanager.elasticsan.models.VolumeGroupTierInfo;
+import com.azure.resourcemanager.elasticsan.models.VolumeTierInfo;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** SkuInformation object. */
+@Fluent
+public final class ResourceTypeSkuInner {
+ /*
+ * The Sku tier
+ */
+ @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY)
+ private List sku;
+
+ /*
+ * Availability of the SKU for the location/zone
+ */
+ @JsonProperty(value = "locationInfo", access = JsonProperty.Access.WRITE_ONLY)
+ private List locationInfo;
+
+ /*
+ * Scalability targets for the San account for a given tier
+ */
+ @JsonProperty(value = "elasticSan")
+ private SanTierInfo elasticSan;
+
+ /*
+ * Volume Group targets for the San account for a given tier
+ */
+ @JsonProperty(value = "volumeGroup")
+ private VolumeGroupTierInfo volumeGroup;
+
+ /*
+ * Volume targets for the San account for a given tier
+ */
+ @JsonProperty(value = "volume")
+ private VolumeTierInfo volume;
+
+ /**
+ * Get the sku property: The Sku tier.
+ *
+ * @return the sku value.
+ */
+ public List sku() {
+ return this.sku;
+ }
+
+ /**
+ * Get the locationInfo property: Availability of the SKU for the location/zone.
+ *
+ * @return the locationInfo value.
+ */
+ public List locationInfo() {
+ return this.locationInfo;
+ }
+
+ /**
+ * Get the elasticSan property: Scalability targets for the San account for a given tier.
+ *
+ * @return the elasticSan value.
+ */
+ public SanTierInfo elasticSan() {
+ return this.elasticSan;
+ }
+
+ /**
+ * Set the elasticSan property: Scalability targets for the San account for a given tier.
+ *
+ * @param elasticSan the elasticSan value to set.
+ * @return the ResourceTypeSkuInner object itself.
+ */
+ public ResourceTypeSkuInner withElasticSan(SanTierInfo elasticSan) {
+ this.elasticSan = elasticSan;
+ return this;
+ }
+
+ /**
+ * Get the volumeGroup property: Volume Group targets for the San account for a given tier.
+ *
+ * @return the volumeGroup value.
+ */
+ public VolumeGroupTierInfo volumeGroup() {
+ return this.volumeGroup;
+ }
+
+ /**
+ * Set the volumeGroup property: Volume Group targets for the San account for a given tier.
+ *
+ * @param volumeGroup the volumeGroup value to set.
+ * @return the ResourceTypeSkuInner object itself.
+ */
+ public ResourceTypeSkuInner withVolumeGroup(VolumeGroupTierInfo volumeGroup) {
+ this.volumeGroup = volumeGroup;
+ return this;
+ }
+
+ /**
+ * Get the volume property: Volume targets for the San account for a given tier.
+ *
+ * @return the volume value.
+ */
+ public VolumeTierInfo volume() {
+ return this.volume;
+ }
+
+ /**
+ * Set the volume property: Volume targets for the San account for a given tier.
+ *
+ * @param volume the volume value to set.
+ * @return the ResourceTypeSkuInner object itself.
+ */
+ public ResourceTypeSkuInner withVolume(VolumeTierInfo volume) {
+ this.volume = volume;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (sku() != null) {
+ sku().forEach(e -> e.validate());
+ }
+ if (locationInfo() != null) {
+ locationInfo().forEach(e -> e.validate());
+ }
+ if (elasticSan() != null) {
+ elasticSan().validate();
+ }
+ if (volumeGroup() != null) {
+ volumeGroup().validate();
+ }
+ if (volume() != null) {
+ volume().validate();
+ }
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java
new file mode 100644
index 0000000000000..9c19c7bb54137
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupInner.java
@@ -0,0 +1,166 @@
+// 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.resourcemanager.elasticsan.models.EncryptionType;
+import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet;
+import com.azure.resourcemanager.elasticsan.models.ProvisioningStates;
+import com.azure.resourcemanager.elasticsan.models.StorageTargetType;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** Response for Volume Group request. */
+@Fluent
+public final class VolumeGroupInner extends ProxyResource {
+ /*
+ * Properties of VolumeGroup.
+ */
+ @JsonProperty(value = "properties")
+ private VolumeGroupProperties innerProperties;
+
+ /*
+ * Resource metadata required by ARM RPC
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * Azure resource tags.
+ */
+ @JsonProperty(value = "tags")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map tags;
+
+ /**
+ * Get the innerProperties property: Properties of VolumeGroup.
+ *
+ * @return the innerProperties value.
+ */
+ private VolumeGroupProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Resource metadata required by ARM RPC.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * 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.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningStates provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the protocolType property: Type of storage target.
+ *
+ * @return the protocolType value.
+ */
+ public StorageTargetType protocolType() {
+ return this.innerProperties() == null ? null : this.innerProperties().protocolType();
+ }
+
+ /**
+ * Set the protocolType property: Type of storage target.
+ *
+ * @param protocolType the protocolType value to set.
+ * @return the VolumeGroupInner object itself.
+ */
+ public VolumeGroupInner withProtocolType(StorageTargetType protocolType) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new VolumeGroupProperties();
+ }
+ this.innerProperties().withProtocolType(protocolType);
+ return this;
+ }
+
+ /**
+ * Get the encryption property: Type of encryption.
+ *
+ * @return the encryption value.
+ */
+ public EncryptionType encryption() {
+ return this.innerProperties() == null ? null : this.innerProperties().encryption();
+ }
+
+ /**
+ * Set the encryption property: Type of encryption.
+ *
+ * @param encryption the encryption value to set.
+ * @return the VolumeGroupInner object itself.
+ */
+ public VolumeGroupInner withEncryption(EncryptionType encryption) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new VolumeGroupProperties();
+ }
+ this.innerProperties().withEncryption(encryption);
+ return this;
+ }
+
+ /**
+ * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations.
+ *
+ * @return the networkAcls value.
+ */
+ public NetworkRuleSet networkAcls() {
+ return this.innerProperties() == null ? null : this.innerProperties().networkAcls();
+ }
+
+ /**
+ * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations.
+ *
+ * @param networkAcls the networkAcls value to set.
+ * @return the VolumeGroupInner object itself.
+ */
+ public VolumeGroupInner withNetworkAcls(NetworkRuleSet networkAcls) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new VolumeGroupProperties();
+ }
+ this.innerProperties().withNetworkAcls(networkAcls);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java
new file mode 100644
index 0000000000000..5a74085eefc2a
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupProperties.java
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.models.EncryptionType;
+import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet;
+import com.azure.resourcemanager.elasticsan.models.ProvisioningStates;
+import com.azure.resourcemanager.elasticsan.models.StorageTargetType;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** VolumeGroup response properties. */
+@Fluent
+public final class VolumeGroupProperties {
+ /*
+ * State of the operation on the resource.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningStates provisioningState;
+
+ /*
+ * Type of storage target
+ */
+ @JsonProperty(value = "protocolType", required = true)
+ private StorageTargetType protocolType;
+
+ /*
+ * Type of encryption
+ */
+ @JsonProperty(value = "encryption", required = true)
+ private EncryptionType encryption;
+
+ /*
+ * A collection of rules governing the accessibility from specific network
+ * locations.
+ */
+ @JsonProperty(value = "networkAcls")
+ private NetworkRuleSet networkAcls;
+
+ /**
+ * Get the provisioningState property: State of the operation on the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningStates provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the protocolType property: Type of storage target.
+ *
+ * @return the protocolType value.
+ */
+ public StorageTargetType protocolType() {
+ return this.protocolType;
+ }
+
+ /**
+ * Set the protocolType property: Type of storage target.
+ *
+ * @param protocolType the protocolType value to set.
+ * @return the VolumeGroupProperties object itself.
+ */
+ public VolumeGroupProperties withProtocolType(StorageTargetType protocolType) {
+ this.protocolType = protocolType;
+ return this;
+ }
+
+ /**
+ * Get the encryption property: Type of encryption.
+ *
+ * @return the encryption value.
+ */
+ public EncryptionType encryption() {
+ return this.encryption;
+ }
+
+ /**
+ * Set the encryption property: Type of encryption.
+ *
+ * @param encryption the encryption value to set.
+ * @return the VolumeGroupProperties object itself.
+ */
+ public VolumeGroupProperties withEncryption(EncryptionType encryption) {
+ this.encryption = encryption;
+ return this;
+ }
+
+ /**
+ * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations.
+ *
+ * @return the networkAcls value.
+ */
+ public NetworkRuleSet networkAcls() {
+ return this.networkAcls;
+ }
+
+ /**
+ * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations.
+ *
+ * @param networkAcls the networkAcls value to set.
+ * @return the VolumeGroupProperties object itself.
+ */
+ public VolumeGroupProperties withNetworkAcls(NetworkRuleSet networkAcls) {
+ this.networkAcls = networkAcls;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (protocolType() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property protocolType in model VolumeGroupProperties"));
+ }
+ if (encryption() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property encryption in model VolumeGroupProperties"));
+ }
+ if (networkAcls() != null) {
+ networkAcls().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupProperties.class);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.java
new file mode 100644
index 0000000000000..5ea21c2f37087
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeGroupUpdateProperties.java
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.models.EncryptionType;
+import com.azure.resourcemanager.elasticsan.models.NetworkRuleSet;
+import com.azure.resourcemanager.elasticsan.models.StorageTargetType;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** VolumeGroup response properties. */
+@Fluent
+public final class VolumeGroupUpdateProperties {
+ /*
+ * Type of storage target
+ */
+ @JsonProperty(value = "protocolType", required = true)
+ private StorageTargetType protocolType;
+
+ /*
+ * Type of encryption
+ */
+ @JsonProperty(value = "encryption", required = true)
+ private EncryptionType encryption;
+
+ /*
+ * A collection of rules governing the accessibility from specific network
+ * locations.
+ */
+ @JsonProperty(value = "networkAcls")
+ private NetworkRuleSet networkAcls;
+
+ /**
+ * Get the protocolType property: Type of storage target.
+ *
+ * @return the protocolType value.
+ */
+ public StorageTargetType protocolType() {
+ return this.protocolType;
+ }
+
+ /**
+ * Set the protocolType property: Type of storage target.
+ *
+ * @param protocolType the protocolType value to set.
+ * @return the VolumeGroupUpdateProperties object itself.
+ */
+ public VolumeGroupUpdateProperties withProtocolType(StorageTargetType protocolType) {
+ this.protocolType = protocolType;
+ return this;
+ }
+
+ /**
+ * Get the encryption property: Type of encryption.
+ *
+ * @return the encryption value.
+ */
+ public EncryptionType encryption() {
+ return this.encryption;
+ }
+
+ /**
+ * Set the encryption property: Type of encryption.
+ *
+ * @param encryption the encryption value to set.
+ * @return the VolumeGroupUpdateProperties object itself.
+ */
+ public VolumeGroupUpdateProperties withEncryption(EncryptionType encryption) {
+ this.encryption = encryption;
+ return this;
+ }
+
+ /**
+ * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations.
+ *
+ * @return the networkAcls value.
+ */
+ public NetworkRuleSet networkAcls() {
+ return this.networkAcls;
+ }
+
+ /**
+ * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations.
+ *
+ * @param networkAcls the networkAcls value to set.
+ * @return the VolumeGroupUpdateProperties object itself.
+ */
+ public VolumeGroupUpdateProperties withNetworkAcls(NetworkRuleSet networkAcls) {
+ this.networkAcls = networkAcls;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (protocolType() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property protocolType in model VolumeGroupUpdateProperties"));
+ }
+ if (encryption() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property encryption in model VolumeGroupUpdateProperties"));
+ }
+ if (networkAcls() != null) {
+ networkAcls().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(VolumeGroupUpdateProperties.class);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.java
new file mode 100644
index 0000000000000..e378be7780f5f
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeInner.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.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
+public final class VolumeInner extends ProxyResource {
+ /*
+ * Properties of Volume.
+ */
+ @JsonProperty(value = "properties")
+ private VolumeProperties innerProperties;
+
+ /*
+ * Resource metadata required by ARM RPC
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * Azure resource tags.
+ */
+ @JsonProperty(value = "tags")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map tags;
+
+ /**
+ * Get the innerProperties property: Properties of Volume.
+ *
+ * @return the innerProperties value.
+ */
+ private VolumeProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Resource metadata required by ARM RPC.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * 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.
+ *
+ * @return the volumeId value.
+ */
+ public String volumeId() {
+ return this.innerProperties() == null ? null : this.innerProperties().volumeId();
+ }
+
+ /**
+ * Get the creationData property: State of the operation on the resource.
+ *
+ * @return the creationData value.
+ */
+ public SourceCreationData creationData() {
+ return this.innerProperties() == null ? null : this.innerProperties().creationData();
+ }
+
+ /**
+ * Set the creationData property: State of the operation on the resource.
+ *
+ * @param creationData the creationData value to set.
+ * @return the VolumeInner object itself.
+ */
+ public VolumeInner withCreationData(SourceCreationData creationData) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new VolumeProperties();
+ }
+ this.innerProperties().withCreationData(creationData);
+ return this;
+ }
+
+ /**
+ * Get the sizeGiB property: Volume size.
+ *
+ * @return the sizeGiB value.
+ */
+ public Long sizeGiB() {
+ return this.innerProperties() == null ? null : this.innerProperties().sizeGiB();
+ }
+
+ /**
+ * Set the sizeGiB property: Volume size.
+ *
+ * @param sizeGiB the sizeGiB value to set.
+ * @return the VolumeInner object itself.
+ */
+ public VolumeInner withSizeGiB(Long sizeGiB) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new VolumeProperties();
+ }
+ this.innerProperties().withSizeGiB(sizeGiB);
+ return this;
+ }
+
+ /**
+ * Get the storageTarget property: Storage target information.
+ *
+ * @return the storageTarget value.
+ */
+ public IscsiTargetInfo storageTarget() {
+ return this.innerProperties() == null ? null : this.innerProperties().storageTarget();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java
new file mode 100644
index 0000000000000..6c88d76458b6f
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeProperties.java
@@ -0,0 +1,110 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo;
+import com.azure.resourcemanager.elasticsan.models.SourceCreationData;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Volume response properties. */
+@Fluent
+public final class VolumeProperties {
+ /*
+ * Unique Id of the volume in GUID format
+ */
+ @JsonProperty(value = "volumeId", access = JsonProperty.Access.WRITE_ONLY)
+ private String volumeId;
+
+ /*
+ * State of the operation on the resource.
+ */
+ @JsonProperty(value = "creationData")
+ private SourceCreationData creationData;
+
+ /*
+ * Volume size.
+ */
+ @JsonProperty(value = "sizeGiB")
+ private Long sizeGiB;
+
+ /*
+ * Storage target information
+ */
+ @JsonProperty(value = "storageTarget", access = JsonProperty.Access.WRITE_ONLY)
+ private IscsiTargetInfo storageTarget;
+
+ /**
+ * Get the volumeId property: Unique Id of the volume in GUID format.
+ *
+ * @return the volumeId value.
+ */
+ public String volumeId() {
+ return this.volumeId;
+ }
+
+ /**
+ * Get the creationData property: State of the operation on the resource.
+ *
+ * @return the creationData value.
+ */
+ public SourceCreationData creationData() {
+ return this.creationData;
+ }
+
+ /**
+ * Set the creationData property: State of the operation on the resource.
+ *
+ * @param creationData the creationData value to set.
+ * @return the VolumeProperties object itself.
+ */
+ public VolumeProperties withCreationData(SourceCreationData creationData) {
+ this.creationData = creationData;
+ return this;
+ }
+
+ /**
+ * Get the sizeGiB property: Volume size.
+ *
+ * @return the sizeGiB value.
+ */
+ public Long sizeGiB() {
+ return this.sizeGiB;
+ }
+
+ /**
+ * Set the sizeGiB property: Volume size.
+ *
+ * @param sizeGiB the sizeGiB value to set.
+ * @return the VolumeProperties object itself.
+ */
+ public VolumeProperties withSizeGiB(Long sizeGiB) {
+ this.sizeGiB = sizeGiB;
+ return this;
+ }
+
+ /**
+ * Get the storageTarget property: Storage target information.
+ *
+ * @return the storageTarget value.
+ */
+ public IscsiTargetInfo storageTarget() {
+ return this.storageTarget;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (creationData() != null) {
+ creationData().validate();
+ }
+ if (storageTarget() != null) {
+ storageTarget().validate();
+ }
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.java
new file mode 100644
index 0000000000000..6bea416abc848
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/VolumeUpdateProperties.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Volume response properties. */
+@Fluent
+public final class VolumeUpdateProperties {
+ /*
+ * Volume size.
+ */
+ @JsonProperty(value = "sizeGiB")
+ private Long sizeGiB;
+
+ /**
+ * Get the sizeGiB property: Volume size.
+ *
+ * @return the sizeGiB value.
+ */
+ public Long sizeGiB() {
+ return this.sizeGiB;
+ }
+
+ /**
+ * Set the sizeGiB property: Volume size.
+ *
+ * @param sizeGiB the sizeGiB value to set.
+ * @return the VolumeUpdateProperties object itself.
+ */
+ public VolumeUpdateProperties withSizeGiB(Long sizeGiB) {
+ this.sizeGiB = sizeGiB;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java
new file mode 100644
index 0000000000000..fdc2bc9ba692d
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/models/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the inner data models for ElasticSanManagement. null. */
+package com.azure.resourcemanager.elasticsan.fluent.models;
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java
new file mode 100644
index 0000000000000..1e24c33da5034
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/fluent/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the service clients for ElasticSanManagement. null. */
+package com.azure.resourcemanager.elasticsan.fluent;
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java
new file mode 100644
index 0000000000000..d73b0e53cb16c
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanImpl.java
@@ -0,0 +1,246 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSan;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate;
+import com.azure.resourcemanager.elasticsan.models.ProvisioningStates;
+import com.azure.resourcemanager.elasticsan.models.Sku;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class ElasticSanImpl implements ElasticSan, ElasticSan.Definition, ElasticSan.Update {
+ private ElasticSanInner innerObject;
+
+ private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Sku sku() {
+ return this.innerModel().sku();
+ }
+
+ public List availabilityZones() {
+ List inner = this.innerModel().availabilityZones();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ProvisioningStates provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public long baseSizeTiB() {
+ return this.innerModel().baseSizeTiB();
+ }
+
+ public long extendedCapacitySizeTiB() {
+ return this.innerModel().extendedCapacitySizeTiB();
+ }
+
+ public Long totalVolumeSizeGiB() {
+ return this.innerModel().totalVolumeSizeGiB();
+ }
+
+ public Long volumeGroupCount() {
+ return this.innerModel().volumeGroupCount();
+ }
+
+ public Long totalIops() {
+ return this.innerModel().totalIops();
+ }
+
+ public Long totalMBps() {
+ return this.innerModel().totalMBps();
+ }
+
+ public Long totalSizeTiB() {
+ return this.innerModel().totalSizeTiB();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public ElasticSanInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String elasticSanName;
+
+ private ElasticSanUpdate updateParameters;
+
+ public ElasticSanImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public ElasticSan create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getElasticSans()
+ .create(resourceGroupName, elasticSanName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public ElasticSan create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getElasticSans()
+ .create(resourceGroupName, elasticSanName, this.innerModel(), context);
+ return this;
+ }
+
+ ElasticSanImpl(String name, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerObject = new ElasticSanInner();
+ this.serviceManager = serviceManager;
+ this.elasticSanName = name;
+ }
+
+ public ElasticSanImpl update() {
+ this.updateParameters = new ElasticSanUpdate();
+ return this;
+ }
+
+ public ElasticSan apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getElasticSans()
+ .update(resourceGroupName, elasticSanName, updateParameters, Context.NONE);
+ return this;
+ }
+
+ public ElasticSan apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getElasticSans()
+ .update(resourceGroupName, elasticSanName, updateParameters, context);
+ return this;
+ }
+
+ ElasticSanImpl(ElasticSanInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.elasticSanName = Utils.getValueFromIdByName(innerObject.id(), "elasticSans");
+ }
+
+ public ElasticSan refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getElasticSans()
+ .getByResourceGroupWithResponse(resourceGroupName, elasticSanName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ElasticSan refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getElasticSans()
+ .getByResourceGroupWithResponse(resourceGroupName, elasticSanName, context)
+ .getValue();
+ return this;
+ }
+
+ public ElasticSanImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public ElasticSanImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public ElasticSanImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateParameters.withTags(tags);
+ return this;
+ }
+ }
+
+ public ElasticSanImpl withSku(Sku sku) {
+ this.innerModel().withSku(sku);
+ return this;
+ }
+
+ public ElasticSanImpl withAvailabilityZones(List availabilityZones) {
+ this.innerModel().withAvailabilityZones(availabilityZones);
+ return this;
+ }
+
+ public ElasticSanImpl withBaseSizeTiB(long baseSizeTiB) {
+ this.innerModel().withBaseSizeTiB(baseSizeTiB);
+ return this;
+ }
+
+ public ElasticSanImpl withExtendedCapacitySizeTiB(long extendedCapacitySizeTiB) {
+ this.innerModel().withExtendedCapacitySizeTiB(extendedCapacitySizeTiB);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java
new file mode 100644
index 0000000000000..78649d24897f2
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementBuilder.java
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the ElasticSanManagementImpl type. */
+@ServiceClientBuilder(serviceClients = {ElasticSanManagementImpl.class})
+public final class ElasticSanManagementBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the ElasticSanManagementBuilder.
+ */
+ public ElasticSanManagementBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the ElasticSanManagementBuilder.
+ */
+ public ElasticSanManagementBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the ElasticSanManagementBuilder.
+ */
+ public ElasticSanManagementBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the ElasticSanManagementBuilder.
+ */
+ public ElasticSanManagementBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the ElasticSanManagementBuilder.
+ */
+ public ElasticSanManagementBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the ElasticSanManagementBuilder.
+ */
+ public ElasticSanManagementBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of ElasticSanManagementImpl with the provided parameters.
+ *
+ * @return an instance of ElasticSanManagementImpl.
+ */
+ public ElasticSanManagementImpl buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (pipeline == null) {
+ this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
+ }
+ ElasticSanManagementImpl client =
+ new ElasticSanManagementImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java
new file mode 100644
index 0000000000000..b17e3e3b58705
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanManagementImpl.java
@@ -0,0 +1,346 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.elasticsan.fluent.ElasticSanManagement;
+import com.azure.resourcemanager.elasticsan.fluent.ElasticSansClient;
+import com.azure.resourcemanager.elasticsan.fluent.OperationsClient;
+import com.azure.resourcemanager.elasticsan.fluent.SkusClient;
+import com.azure.resourcemanager.elasticsan.fluent.VolumeGroupsClient;
+import com.azure.resourcemanager.elasticsan.fluent.VolumesClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the ElasticSanManagementImpl type. */
+@ServiceClient(builder = ElasticSanManagementBuilder.class)
+public final class ElasticSanManagementImpl implements ElasticSanManagement {
+ /** The ID of the target subscription. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The OperationsClient object to access its operations. */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /** The SkusClient object to access its operations. */
+ private final SkusClient skus;
+
+ /**
+ * Gets the SkusClient object to access its operations.
+ *
+ * @return the SkusClient object.
+ */
+ public SkusClient getSkus() {
+ return this.skus;
+ }
+
+ /** The ElasticSansClient object to access its operations. */
+ private final ElasticSansClient elasticSans;
+
+ /**
+ * Gets the ElasticSansClient object to access its operations.
+ *
+ * @return the ElasticSansClient object.
+ */
+ public ElasticSansClient getElasticSans() {
+ return this.elasticSans;
+ }
+
+ /** The VolumeGroupsClient object to access its operations. */
+ private final VolumeGroupsClient volumeGroups;
+
+ /**
+ * Gets the VolumeGroupsClient object to access its operations.
+ *
+ * @return the VolumeGroupsClient object.
+ */
+ public VolumeGroupsClient getVolumeGroups() {
+ return this.volumeGroups;
+ }
+
+ /** The VolumesClient object to access its operations. */
+ private final VolumesClient volumes;
+
+ /**
+ * Gets the VolumesClient object to access its operations.
+ *
+ * @return the VolumesClient object.
+ */
+ public VolumesClient getVolumes() {
+ return this.volumes;
+ }
+
+ /**
+ * Initializes an instance of ElasticSanManagement client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription.
+ * @param endpoint server parameter.
+ */
+ ElasticSanManagementImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2021-11-20-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.skus = new SkusClientImpl(this);
+ this.elasticSans = new ElasticSansClientImpl(this);
+ this.volumeGroups = new VolumeGroupsClientImpl(this);
+ this.volumes = new VolumesClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(
+ Mono>> activationResponse,
+ HttpPipeline httpPipeline,
+ Type pollResultType,
+ Type finalResultType,
+ Context context) {
+ return PollerFactory
+ .create(
+ serializerAdapter,
+ httpPipeline,
+ pollResultType,
+ finalResultType,
+ defaultPollInterval,
+ activationResponse,
+ context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse =
+ new HttpResponseImpl(
+ lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError =
+ this
+ .getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(s);
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ElasticSanManagementImpl.class);
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java
new file mode 100644
index 0000000000000..f356292f67b28
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSanRPOperationImpl.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationDisplay;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation;
+
+public final class ElasticSanRPOperationImpl implements ElasticSanRPOperation {
+ private ElasticSanRPOperationInner innerObject;
+
+ private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager;
+
+ ElasticSanRPOperationImpl(
+ ElasticSanRPOperationInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public ElasticSanOperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public ElasticSanRPOperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java
new file mode 100644
index 0000000000000..0229640fc9295
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansClientImpl.java
@@ -0,0 +1,1531 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.elasticsan.fluent.ElasticSansClient;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanList;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanUpdate;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ElasticSansClient. */
+public final class ElasticSansClientImpl implements ElasticSansClient {
+ /** The proxy service used to perform REST calls. */
+ private final ElasticSansService service;
+
+ /** The service client containing this operation class. */
+ private final ElasticSanManagementImpl client;
+
+ /**
+ * Initializes an instance of ElasticSansClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ElasticSansClientImpl(ElasticSanManagementImpl client) {
+ this.service =
+ RestProxy.create(ElasticSansService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ElasticSanManagementElasticSans to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ElasticSanManagement")
+ private interface ElasticSansService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan"
+ + "/elasticSans")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan"
+ + "/elasticSans/{elasticSanName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("elasticSanName") String elasticSanName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") ElasticSanInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan"
+ + "/elasticSans/{elasticSanName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("elasticSanName") String elasticSanName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") ElasticSanUpdate parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan"
+ + "/elasticSans/{elasticSanName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("elasticSanName") String elasticSanName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan"
+ + "/elasticSans/{elasticSanName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("elasticSanName") String elasticSanName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets a list of ElasticSans in a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSans in a subscription as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Gets a list of ElasticSan in a resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan in a resource group as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ElasticSanInner> beginCreateAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters) {
+ Mono>> mono = createWithResponseAsync(resourceGroupName, elasticSanName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ElasticSanInner.class,
+ ElasticSanInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ElasticSanInner> beginCreateAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createWithResponseAsync(resourceGroupName, elasticSanName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ElasticSanInner.class, ElasticSanInner.class, context);
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ElasticSanInner> beginCreate(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters) {
+ return beginCreateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ElasticSanInner> beginCreate(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) {
+ return beginCreateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters) {
+ return beginCreateAsync(resourceGroupName, elasticSanName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) {
+ return beginCreateAsync(resourceGroupName, elasticSanName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ElasticSanInner create(String resourceGroupName, String elasticSanName, ElasticSanInner parameters) {
+ return createAsync(resourceGroupName, elasticSanName, parameters).block();
+ }
+
+ /**
+ * Create ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ElasticSanInner create(
+ String resourceGroupName, String elasticSanName, ElasticSanInner parameters, Context context) {
+ return createAsync(resourceGroupName, elasticSanName, parameters, context).block();
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ElasticSanInner> beginUpdateAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, elasticSanName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ElasticSanInner.class,
+ ElasticSanInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ElasticSanInner> beginUpdateAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, elasticSanName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ElasticSanInner.class, ElasticSanInner.class, context);
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ElasticSanInner> beginUpdate(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) {
+ return beginUpdateAsync(resourceGroupName, elasticSanName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ElasticSanInner> beginUpdate(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) {
+ return beginUpdateAsync(resourceGroupName, elasticSanName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) {
+ return beginUpdateAsync(resourceGroupName, elasticSanName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) {
+ return beginUpdateAsync(resourceGroupName, elasticSanName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ElasticSanInner update(String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters) {
+ return updateAsync(resourceGroupName, elasticSanName, parameters).block();
+ }
+
+ /**
+ * Update a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param parameters Elastic San object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for ElasticSan request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ElasticSanInner update(
+ String resourceGroupName, String elasticSanName, ElasticSanUpdate parameters, Context context) {
+ return updateAsync(resourceGroupName, elasticSanName, parameters, context).block();
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown 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) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown 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, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown 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) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, elasticSanName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown 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, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, elasticSanName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown 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) {
+ return beginDeleteAsync(resourceGroupName, elasticSanName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown 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, Context context) {
+ return beginDeleteAsync(resourceGroupName, elasticSanName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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) {
+ return beginDeleteAsync(resourceGroupName, elasticSanName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException 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, Context context) {
+ return beginDeleteAsync(resourceGroupName, elasticSanName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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) {
+ deleteAsync(resourceGroupName, elasticSanName).block();
+ }
+
+ /**
+ * Delete a Elastic San.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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, Context context) {
+ deleteAsync(resourceGroupName, elasticSanName, context).block();
+ }
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String elasticSanName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String elasticSanName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (elasticSanName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter elasticSanName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ elasticSanName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String elasticSanName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, elasticSanName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ElasticSanInner getByResourceGroup(String resourceGroupName, String elasticSanName) {
+ return getByResourceGroupAsync(resourceGroupName, elasticSanName).block();
+ }
+
+ /**
+ * Get a ElasticSan.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param elasticSanName The name of the ElasticSan.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a ElasticSan along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String elasticSanName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, elasticSanName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of Elastic Sans along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.java
new file mode 100644
index 0000000000000..159685209939c
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ElasticSansImpl.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.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.fluent.ElasticSansClient;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSan;
+import com.azure.resourcemanager.elasticsan.models.ElasticSans;
+
+public final class ElasticSansImpl implements ElasticSans {
+ private static final ClientLogger LOGGER = new ClientLogger(ElasticSansImpl.class);
+
+ private final ElasticSansClient innerClient;
+
+ private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager;
+
+ public ElasticSansImpl(
+ ElasticSansClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new ElasticSanImpl(inner1, this.manager()));
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String elasticSanName) {
+ this.serviceClient().delete(resourceGroupName, elasticSanName);
+ }
+
+ public void delete(String resourceGroupName, String elasticSanName, Context context) {
+ this.serviceClient().delete(resourceGroupName, elasticSanName, context);
+ }
+
+ public ElasticSan getByResourceGroup(String resourceGroupName, String elasticSanName) {
+ ElasticSanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, elasticSanName);
+ if (inner != null) {
+ return new ElasticSanImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String elasticSanName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, elasticSanName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new ElasticSanImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ElasticSan getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String elasticSanName = Utils.getValueFromIdByName(id, "elasticSans");
+ if (elasticSanName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, elasticSanName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String elasticSanName = Utils.getValueFromIdByName(id, "elasticSans");
+ if (elasticSanName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, elasticSanName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String elasticSanName = Utils.getValueFromIdByName(id, "elasticSans");
+ if (elasticSanName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'elasticSans'.", id)));
+ }
+ this.delete(resourceGroupName, elasticSanName, 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)));
+ }
+ this.delete(resourceGroupName, elasticSanName, context);
+ }
+
+ private ElasticSansClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() {
+ return this.serviceManager;
+ }
+
+ public ElasticSanImpl define(String name) {
+ return new ElasticSanImpl(name, this.manager());
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..116f9e542908e
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsClientImpl.java
@@ -0,0 +1,175 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.elasticsan.fluent.OperationsClient;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanOperationListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public final class OperationsClientImpl implements OperationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final OperationsService service;
+
+ /** The service client containing this operation class. */
+ private final ElasticSanManagementImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(ElasticSanManagementImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ElasticSanManagementOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ElasticSanManagement")
+ private interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.ElasticSan/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
+ }
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync());
+ }
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context));
+ }
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets a list of ElasticSan operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of ElasticSan operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..65ef49da713b0
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.fluent.OperationsClient;
+import com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanRPOperationInner;
+import com.azure.resourcemanager.elasticsan.models.ElasticSanRPOperation;
+import com.azure.resourcemanager.elasticsan.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager;
+
+ public OperationsImpl(
+ OperationsClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new ElasticSanRPOperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new ElasticSanRPOperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.java
new file mode 100644
index 0000000000000..01d6ef713b28b
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/ResourceTypeSkuImpl.java
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner;
+import com.azure.resourcemanager.elasticsan.models.ResourceTypeSku;
+import com.azure.resourcemanager.elasticsan.models.SanTierInfo;
+import com.azure.resourcemanager.elasticsan.models.Sku;
+import com.azure.resourcemanager.elasticsan.models.SkuLocationInfo;
+import com.azure.resourcemanager.elasticsan.models.VolumeGroupTierInfo;
+import com.azure.resourcemanager.elasticsan.models.VolumeTierInfo;
+import java.util.Collections;
+import java.util.List;
+
+public final class ResourceTypeSkuImpl implements ResourceTypeSku {
+ private ResourceTypeSkuInner innerObject;
+
+ private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager;
+
+ ResourceTypeSkuImpl(
+ ResourceTypeSkuInner innerObject, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public List sku() {
+ List inner = this.innerModel().sku();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List locationInfo() {
+ List inner = this.innerModel().locationInfo();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public SanTierInfo elasticSan() {
+ return this.innerModel().elasticSan();
+ }
+
+ public VolumeGroupTierInfo volumeGroup() {
+ return this.innerModel().volumeGroup();
+ }
+
+ public VolumeTierInfo volume() {
+ return this.innerModel().volume();
+ }
+
+ public ResourceTypeSkuInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java
new file mode 100644
index 0000000000000..420eba8bd9e0f
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusClientImpl.java
@@ -0,0 +1,197 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.elasticsan.fluent.SkusClient;
+import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner;
+import com.azure.resourcemanager.elasticsan.models.SkuInformationList;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in SkusClient. */
+public final class SkusClientImpl implements SkusClient {
+ /** The proxy service used to perform REST calls. */
+ private final SkusService service;
+
+ /** The service client containing this operation class. */
+ private final ElasticSanManagementImpl client;
+
+ /**
+ * Initializes an instance of SkusClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SkusClientImpl(ElasticSanManagementImpl client) {
+ this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ElasticSanManagementSkus to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ElasticSanManagement")
+ private interface SkusService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.ElasticSan/skus")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @param filter Specify $filter='location eq <location>' to filter on location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service.list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @param filter Specify $filter='location eq <location>' to filter on location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), filter, accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @param filter Specify $filter='location eq <location>' to filter on location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String filter) {
+ return new PagedFlux<>(() -> listSinglePageAsync(filter));
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ final String filter = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(filter));
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @param filter Specify $filter='location eq <location>' to filter on location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String filter, Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(filter, context));
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(filter));
+ }
+
+ /**
+ * List all the available Skus in the region and information related to them.
+ *
+ * @param filter Specify $filter='location eq <location>' to filter on location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of SKU Information objects as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String filter, Context context) {
+ return new PagedIterable<>(listAsync(filter, context));
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.java
new file mode 100644
index 0000000000000..1344f14e951b4
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/SkusImpl.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.elasticsan.fluent.SkusClient;
+import com.azure.resourcemanager.elasticsan.fluent.models.ResourceTypeSkuInner;
+import com.azure.resourcemanager.elasticsan.models.ResourceTypeSku;
+import com.azure.resourcemanager.elasticsan.models.Skus;
+
+public final class SkusImpl implements Skus {
+ private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class);
+
+ private final SkusClient innerClient;
+
+ private final com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager;
+
+ public SkusImpl(SkusClient innerClient, com.azure.resourcemanager.elasticsan.ElasticSanManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new ResourceTypeSkuImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String filter, Context context) {
+ PagedIterable inner = this.serviceClient().list(filter, context);
+ return Utils.mapPage(inner, inner1 -> new ResourceTypeSkuImpl(inner1, this.manager()));
+ }
+
+ private SkusClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.elasticsan.ElasticSanManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/Utils.java b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/Utils.java
new file mode 100644
index 0000000000000..c64a3fa8f585c
--- /dev/null
+++ b/sdk/elasticsan/azure-resourcemanager-elasticsan/src/main/java/com/azure/resourcemanager/elasticsan/implementation/Utils.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.elasticsan.implementation;
+
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class Utils {
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (segments.size() > 0 && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(
+ PagedFlux
+ .create(
+ () ->
+ (continuationToken, pageSize) ->
+ Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page ->
+ new PagedResponseBase(
+ page.getRequest(),
+ page.getStatusCode(),
+ page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()),
+ page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl