diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 753220635becd..1dfc1b3f129d3 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -197,6 +197,7 @@ com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0-
com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2
+com.azure.resourcemanager:azure-resourcemanager-storagepool;1.0.0-beta.1;1.0.0-beta.1
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
diff --git a/pom.xml b/pom.xml
index 0d1c2a17109ae..9d467637a5fa6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -581,6 +581,7 @@
sdk/springsdk/sqlvirtualmachinesdk/storage
+ sdk/storagepoolsdk/synapsesdk/tablessdk/template
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/CHANGELOG.md b/sdk/storagepool/azure-resourcemanager-storagepool/CHANGELOG.md
new file mode 100644
index 0000000000000..e76a7f5be8ed0
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 1.0.0-beta.1 (2021-01-28)
+
+- Azure Resource Manager StoragePool client library for Java. This package contains Microsoft Azure SDK for StoragePool Management SDK. Package tag package-2020-03-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/README.md b/sdk/storagepool/azure-resourcemanager-storagepool/README.md
new file mode 100644
index 0000000000000..c2a678abf9346
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/README.md
@@ -0,0 +1,99 @@
+# Azure Resource Manager StoragePool client library for Java
+
+Azure Resource Manager StoragePool client library for Java.
+
+This package contains Microsoft Azure SDK for StoragePool Management SDK. Package tag package-2020-03-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+
+## We'd love to hear your feedback
+
+We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
+
+If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
+
+Thank you in advance for your collaboration. We really appreciate your time!
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+
+## Getting started
+
+### Prerequisites
+
+- [Java Development Kit (JDK)][jdk] with version 8 or above
+- [Azure Subscription][azure_subscription]
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-storagepool;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-storagepool
+ 1.0.0-beta.1
+
+```
+[//]: # ({x-version-update-end})
+
+### Include the recommended packages
+
+Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
+
+[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
+
+### Authentication
+
+By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
+
+- `AZURE_CLIENT_ID` for Azure client ID.
+- `AZURE_TENANT_ID` for Azure tenant ID.
+- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+
+In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
+
+With above configuration, `azure` client can be authenticated by following code:
+
+```java
+AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+TokenCredential credential = new DefaultAzureCredentialBuilder()
+ .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
+ .build();
+StoragePoolManager manager = StoragePoolManager
+ .authenticate(credential, profile);
+```
+
+The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+
+See [Authentication][authenticate] for more options.
+
+## Key concepts
+
+See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
+
+## Examples
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://docs.microsoft.com/java/azure/jdk/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity
+[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty
+[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md
+[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml b/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml
new file mode 100644
index 0000000000000..3b41236fda915
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/pom.xml
@@ -0,0 +1,62 @@
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-storagepool
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for StoragePool Management
+ This package contains Microsoft Azure SDK for StoragePool Management SDK. Package tag package-2020-03-15-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+
+
+
+
+ com.azure
+ azure-core-management
+ 1.1.0
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.5
+
+ true
+
+
+
+
+
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/StoragePoolManager.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/StoragePoolManager.java
new file mode 100644
index 0000000000000..8372a96e1cb68
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/StoragePoolManager.java
@@ -0,0 +1,238 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool;
+
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagepool.fluent.StoragePoolManagement;
+import com.azure.resourcemanager.storagepool.implementation.DiskPoolsImpl;
+import com.azure.resourcemanager.storagepool.implementation.IscsiTargetsImpl;
+import com.azure.resourcemanager.storagepool.implementation.OperationsImpl;
+import com.azure.resourcemanager.storagepool.implementation.StoragePoolManagementBuilder;
+import com.azure.resourcemanager.storagepool.models.DiskPools;
+import com.azure.resourcemanager.storagepool.models.IscsiTargets;
+import com.azure.resourcemanager.storagepool.models.Operations;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** Entry point to StoragePoolManager. */
+public final class StoragePoolManager {
+ private Operations operations;
+
+ private DiskPools diskPools;
+
+ private IscsiTargets iscsiTargets;
+
+ private final StoragePoolManagement clientObject;
+
+ private StoragePoolManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ this.clientObject =
+ new StoragePoolManagementBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
+ }
+
+ /**
+ * Creates an instance of StoragePool service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the StoragePool service API instance.
+ */
+ public static StoragePoolManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return configure().authenticate(credential, profile);
+ }
+
+ /**
+ * Gets a Configurable instance that can be used to create StoragePoolManager with optional configuration.
+ *
+ * @return the Configurable instance allowing configurations.
+ */
+ public static Configurable configure() {
+ return new StoragePoolManager.Configurable();
+ }
+
+ /** The Configurable allowing configurations to be set. */
+ public static final class Configurable {
+ private final ClientLogger logger = new ClientLogger(Configurable.class);
+
+ private HttpClient httpClient;
+ private HttpLogOptions httpLogOptions;
+ private final List policies = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ 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;
+ }
+
+ /**
+ * 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 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, "'retryPolicy' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of StoragePool service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the StoragePool service API instance.
+ */
+ public StoragePoolManager 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.storagepool")
+ .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 (retryPolicy == null) {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new RequestIdPolicy());
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies
+ .add(
+ new BearerTokenAuthenticationPolicy(
+ credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new StoragePoolManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /** @return Resource collection API of Operations. */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /** @return Resource collection API of DiskPools. */
+ public DiskPools diskPools() {
+ if (this.diskPools == null) {
+ this.diskPools = new DiskPoolsImpl(clientObject.getDiskPools(), this);
+ }
+ return diskPools;
+ }
+
+ /** @return Resource collection API of IscsiTargets. */
+ public IscsiTargets iscsiTargets() {
+ if (this.iscsiTargets == null) {
+ this.iscsiTargets = new IscsiTargetsImpl(clientObject.getIscsiTargets(), this);
+ }
+ return iscsiTargets;
+ }
+
+ /**
+ * @return Wrapped service client StoragePoolManagement providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public StoragePoolManagement serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolsClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolsClient.java
new file mode 100644
index 0000000000000..6ef8254189337
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/DiskPoolsClient.java
@@ -0,0 +1,268 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.storagepool.fluent.models.DiskPoolInner;
+import com.azure.resourcemanager.storagepool.models.DiskPoolCreate;
+import com.azure.resourcemanager.storagepool.models.DiskPoolUpdate;
+
+/** An instance of this class provides access to all the operations defined in DiskPoolsClient. */
+public interface DiskPoolsClient {
+ /**
+ * Gets a list of Disk Pools 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 Disk Pools in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets a list of Disk Pools 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 Disk Pools in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Gets a list of DiskPools 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 DiskPools in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets a list of DiskPools 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 DiskPools in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, DiskPoolInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload);
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, DiskPoolInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context);
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskPoolInner createOrUpdate(String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload);
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskPoolInner createOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context);
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, DiskPoolInner> beginUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload);
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, DiskPoolInner> beginUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context);
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskPoolInner update(String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload);
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskPoolInner update(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context);
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskPoolName);
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String diskPoolName, Context context);
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 diskPoolName);
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 diskPoolName, Context context);
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ DiskPoolInner getByResourceGroup(String resourceGroupName, String diskPoolName);
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String diskPoolName, Context context);
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/IscsiTargetsClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/IscsiTargetsClient.java
new file mode 100644
index 0000000000000..e8188faadfacb
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/IscsiTargetsClient.java
@@ -0,0 +1,294 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.storagepool.fluent.models.IscsiTargetInner;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetCreate;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetUpdate;
+
+/** An instance of this class provides access to all the operations defined in IscsiTargetsClient. */
+public interface IscsiTargetsClient {
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName);
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName, Context context);
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, IscsiTargetInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload);
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, IscsiTargetInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ Context context);
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ IscsiTargetInner createOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload);
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ IscsiTargetInner createOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ Context context);
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, IscsiTargetInner> beginUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload);
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, IscsiTargetInner> beginUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ Context context);
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ IscsiTargetInner update(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload);
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ IscsiTargetInner update(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ Context context);
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName);
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context);
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 diskPoolName, String iscsiTargetName);
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.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 diskPoolName, String iscsiTargetName, Context context);
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ IscsiTargetInner get(String resourceGroupName, String diskPoolName, String iscsiTargetName);
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context);
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/OperationsClient.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..9a803ae5ad685
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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.storagepool.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.storagepool.fluent.models.StoragePoolRPOperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Gets a list of StoragePool 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 StoragePool operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets a list of StoragePool 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 StoragePool operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/StoragePoolManagement.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/StoragePoolManagement.java
new file mode 100644
index 0000000000000..ade6b08ad793f
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/StoragePoolManagement.java
@@ -0,0 +1,67 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for StoragePoolManagement class. */
+public interface StoragePoolManagement {
+ /**
+ * 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 DiskPoolsClient object to access its operations.
+ *
+ * @return the DiskPoolsClient object.
+ */
+ DiskPoolsClient getDiskPools();
+
+ /**
+ * Gets the IscsiTargetsClient object to access its operations.
+ *
+ * @return the IscsiTargetsClient object.
+ */
+ IscsiTargetsClient getIscsiTargets();
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolInner.java
new file mode 100644
index 0000000000000..196e15c0f8528
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/DiskPoolInner.java
@@ -0,0 +1,261 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.management.Resource;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagepool.models.Disk;
+import com.azure.resourcemanager.storagepool.models.DiskPoolTier;
+import com.azure.resourcemanager.storagepool.models.OperationalStatus;
+import com.azure.resourcemanager.storagepool.models.ProvisioningStates;
+import com.azure.resourcemanager.storagepool.models.SystemMetadata;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** Response for Disk pool request. */
+@JsonFlatten
+@Fluent
+public class DiskPoolInner extends Resource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolInner.class);
+
+ /*
+ * Resource metadata required by ARM RPC
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemMetadata systemData;
+
+ /*
+ * State of the operation on the resource.
+ */
+ @JsonProperty(value = "properties.provisioningState", required = true, access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningStates provisioningState;
+
+ /*
+ * Logical zone for Disk pool resource; example: ["1"].
+ */
+ @JsonProperty(value = "properties.availabilityZones", required = true)
+ private List availabilityZones;
+
+ /*
+ * Operational status of the Disk pool.
+ */
+ @JsonProperty(value = "properties.status", required = true)
+ private OperationalStatus status;
+
+ /*
+ * List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks
+ * at most.
+ */
+ @JsonProperty(value = "properties.disks")
+ private List disks;
+
+ /*
+ * Azure Resource ID of a Subnet for the Disk pool.
+ */
+ @JsonProperty(value = "properties.subnetId", required = true)
+ private String subnetId;
+
+ /*
+ * List of additional capabilities for Disk pool.
+ */
+ @JsonProperty(value = "properties.additionalCapabilities")
+ private List additionalCapabilities;
+
+ /*
+ * Determines the SKU of VM deployed for Disk pool
+ */
+ @JsonProperty(value = "properties.tier", required = true)
+ private DiskPoolTier tier;
+
+ /**
+ * Get the systemData property: Resource metadata required by ARM RPC.
+ *
+ * @return the systemData value.
+ */
+ public SystemMetadata systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the provisioningState property: State of the operation on the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningStates provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the availabilityZones property: Logical zone for Disk pool resource; example: ["1"].
+ *
+ * @return the availabilityZones value.
+ */
+ public List availabilityZones() {
+ return this.availabilityZones;
+ }
+
+ /**
+ * Set the availabilityZones property: Logical zone for Disk pool resource; example: ["1"].
+ *
+ * @param availabilityZones the availabilityZones value to set.
+ * @return the DiskPoolInner object itself.
+ */
+ public DiskPoolInner withAvailabilityZones(List availabilityZones) {
+ this.availabilityZones = availabilityZones;
+ return this;
+ }
+
+ /**
+ * Get the status property: Operational status of the Disk pool.
+ *
+ * @return the status value.
+ */
+ public OperationalStatus status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: Operational status of the Disk pool.
+ *
+ * @param status the status value to set.
+ * @return the DiskPoolInner object itself.
+ */
+ public DiskPoolInner withStatus(OperationalStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the disks property: List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
+ *
+ * @return the disks value.
+ */
+ public List disks() {
+ return this.disks;
+ }
+
+ /**
+ * Set the disks property: List of Azure Managed Disks to attach to a Disk pool. Can attach 8 disks at most.
+ *
+ * @param disks the disks value to set.
+ * @return the DiskPoolInner object itself.
+ */
+ public DiskPoolInner withDisks(List disks) {
+ this.disks = disks;
+ return this;
+ }
+
+ /**
+ * Get the subnetId property: Azure Resource ID of a Subnet for the Disk pool.
+ *
+ * @return the subnetId value.
+ */
+ public String subnetId() {
+ return this.subnetId;
+ }
+
+ /**
+ * Set the subnetId property: Azure Resource ID of a Subnet for the Disk pool.
+ *
+ * @param subnetId the subnetId value to set.
+ * @return the DiskPoolInner object itself.
+ */
+ public DiskPoolInner withSubnetId(String subnetId) {
+ this.subnetId = subnetId;
+ return this;
+ }
+
+ /**
+ * Get the additionalCapabilities property: List of additional capabilities for Disk pool.
+ *
+ * @return the additionalCapabilities value.
+ */
+ public List additionalCapabilities() {
+ return this.additionalCapabilities;
+ }
+
+ /**
+ * Set the additionalCapabilities property: List of additional capabilities for Disk pool.
+ *
+ * @param additionalCapabilities the additionalCapabilities value to set.
+ * @return the DiskPoolInner object itself.
+ */
+ public DiskPoolInner withAdditionalCapabilities(List additionalCapabilities) {
+ this.additionalCapabilities = additionalCapabilities;
+ return this;
+ }
+
+ /**
+ * Get the tier property: Determines the SKU of VM deployed for Disk pool.
+ *
+ * @return the tier value.
+ */
+ public DiskPoolTier tier() {
+ return this.tier;
+ }
+
+ /**
+ * Set the tier property: Determines the SKU of VM deployed for Disk pool.
+ *
+ * @param tier the tier value to set.
+ * @return the DiskPoolInner object itself.
+ */
+ public DiskPoolInner withTier(DiskPoolTier tier) {
+ this.tier = tier;
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public DiskPoolInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public DiskPoolInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (systemData() != null) {
+ systemData().validate();
+ }
+ if (availabilityZones() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property availabilityZones in model DiskPoolInner"));
+ }
+ if (status() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property status in model DiskPoolInner"));
+ }
+ if (disks() != null) {
+ disks().forEach(e -> e.validate());
+ }
+ if (subnetId() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property subnetId in model DiskPoolInner"));
+ }
+ if (tier() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property tier in model DiskPoolInner"));
+ }
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/IscsiTargetInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/IscsiTargetInner.java
new file mode 100644
index 0000000000000..bf100650c1b7d
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/IscsiTargetInner.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.storagepool.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagepool.models.OperationalStatus;
+import com.azure.resourcemanager.storagepool.models.ProvisioningStates;
+import com.azure.resourcemanager.storagepool.models.TargetPortalGroup;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Response for iSCSI target requests. */
+@JsonFlatten
+@Fluent
+public class IscsiTargetInner extends ProxyResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetInner.class);
+
+ /*
+ * State of the operation on the resource.
+ */
+ @JsonProperty(value = "properties.provisioningState", required = true, access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningStates provisioningState;
+
+ /*
+ * Operational status of the iSCSI target.
+ */
+ @JsonProperty(value = "properties.status", required = true)
+ private OperationalStatus status;
+
+ /*
+ * List of iSCSI target portal groups. Can have 1 portal group at most.
+ */
+ @JsonProperty(value = "properties.tpgs", required = true)
+ private List tpgs;
+
+ /*
+ * iSCSI target IQN (iSCSI Qualified Name); example:
+ * "iqn.2005-03.org.iscsi:server".
+ */
+ @JsonProperty(value = "properties.targetIqn", required = true)
+ private String targetIqn;
+
+ /**
+ * Get the provisioningState property: State of the operation on the resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningStates provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the status property: Operational status of the iSCSI target.
+ *
+ * @return the status value.
+ */
+ public OperationalStatus status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: Operational status of the iSCSI target.
+ *
+ * @param status the status value to set.
+ * @return the IscsiTargetInner object itself.
+ */
+ public IscsiTargetInner withStatus(OperationalStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the tpgs property: List of iSCSI target portal groups. Can have 1 portal group at most.
+ *
+ * @return the tpgs value.
+ */
+ public List tpgs() {
+ return this.tpgs;
+ }
+
+ /**
+ * Set the tpgs property: List of iSCSI target portal groups. Can have 1 portal group at most.
+ *
+ * @param tpgs the tpgs value to set.
+ * @return the IscsiTargetInner object itself.
+ */
+ public IscsiTargetInner withTpgs(List tpgs) {
+ this.tpgs = tpgs;
+ return this;
+ }
+
+ /**
+ * Get the targetIqn property: iSCSI target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
+ *
+ * @return the targetIqn value.
+ */
+ public String targetIqn() {
+ return this.targetIqn;
+ }
+
+ /**
+ * Set the targetIqn property: iSCSI target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
+ *
+ * @param targetIqn the targetIqn value to set.
+ * @return the IscsiTargetInner object itself.
+ */
+ public IscsiTargetInner withTargetIqn(String targetIqn) {
+ this.targetIqn = targetIqn;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (status() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property status in model IscsiTargetInner"));
+ }
+ if (tpgs() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property tpgs in model IscsiTargetInner"));
+ } else {
+ tpgs().forEach(e -> e.validate());
+ }
+ if (targetIqn() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property targetIqn in model IscsiTargetInner"));
+ }
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/StoragePoolRPOperationInner.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/StoragePoolRPOperationInner.java
new file mode 100644
index 0000000000000..f7cc7240298b3
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/StoragePoolRPOperationInner.java
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagepool.models.StoragePoolOperationDisplay;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Description of a StoragePool RP Operation. */
+@Fluent
+public final class StoragePoolRPOperationInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(StoragePoolRPOperationInner.class);
+
+ /*
+ * 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", required = true)
+ private boolean isDataAction;
+
+ /*
+ * Indicates the action type.
+ */
+ @JsonProperty(value = "actionType")
+ private String actionType;
+
+ /*
+ * Additional metadata about RP operation.
+ */
+ @JsonProperty(value = "display", required = true)
+ private StoragePoolOperationDisplay display;
+
+ /*
+ * The intended executor of the operation; governs the display of the
+ * operation in the RBAC UX and the audit logs UX.
+ */
+ @JsonProperty(value = "origin")
+ private String origin;
+
+ /**
+ * 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 StoragePoolRPOperationInner object itself.
+ */
+ public StoragePoolRPOperationInner 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;
+ }
+
+ /**
+ * Set the isDataAction property: Indicates whether the operation applies to data-plane.
+ *
+ * @param isDataAction the isDataAction value to set.
+ * @return the StoragePoolRPOperationInner object itself.
+ */
+ public StoragePoolRPOperationInner withIsDataAction(boolean isDataAction) {
+ this.isDataAction = isDataAction;
+ return this;
+ }
+
+ /**
+ * Get the actionType property: Indicates the action type.
+ *
+ * @return the actionType value.
+ */
+ public String actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Set the actionType property: Indicates the action type.
+ *
+ * @param actionType the actionType value to set.
+ * @return the StoragePoolRPOperationInner object itself.
+ */
+ public StoragePoolRPOperationInner withActionType(String actionType) {
+ this.actionType = actionType;
+ return this;
+ }
+
+ /**
+ * Get the display property: Additional metadata about RP operation.
+ *
+ * @return the display value.
+ */
+ public StoragePoolOperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Additional metadata about RP operation.
+ *
+ * @param display the display value to set.
+ * @return the StoragePoolRPOperationInner object itself.
+ */
+ public StoragePoolRPOperationInner withDisplay(StoragePoolOperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; governs the display of the operation in the RBAC
+ * UX and the audit logs UX.
+ *
+ * @return the origin value.
+ */
+ public String origin() {
+ return this.origin;
+ }
+
+ /**
+ * Set the origin property: The intended executor of the operation; governs the display of the operation in the RBAC
+ * UX and the audit logs UX.
+ *
+ * @param origin the origin value to set.
+ * @return the StoragePoolRPOperationInner object itself.
+ */
+ public StoragePoolRPOperationInner withOrigin(String origin) {
+ this.origin = origin;
+ return this;
+ }
+
+ /**
+ * 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 StoragePoolRPOperationInner"));
+ }
+ if (display() == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property display in model StoragePoolRPOperationInner"));
+ } else {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/models/package-info.java
new file mode 100644
index 0000000000000..fef64fea33699
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */
+package com.azure.resourcemanager.storagepool.fluent.models;
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/package-info.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/fluent/package-info.java
new file mode 100644
index 0000000000000..af740edf24db4
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/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 StoragePoolManagement. null. */
+package com.azure.resourcemanager.storagepool.fluent;
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolImpl.java
new file mode 100644
index 0000000000000..2fd2d7154805c
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolImpl.java
@@ -0,0 +1,257 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.storagepool.StoragePoolManager;
+import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner;
+import com.azure.resourcemanager.storagepool.models.Disk;
+import com.azure.resourcemanager.storagepool.models.DiskPool;
+import com.azure.resourcemanager.storagepool.models.DiskPoolCreate;
+import com.azure.resourcemanager.storagepool.models.DiskPoolTier;
+import com.azure.resourcemanager.storagepool.models.DiskPoolUpdate;
+import com.azure.resourcemanager.storagepool.models.OperationalStatus;
+import com.azure.resourcemanager.storagepool.models.ProvisioningStates;
+import com.azure.resourcemanager.storagepool.models.SystemMetadata;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class DiskPoolImpl implements DiskPool, DiskPool.Definition, DiskPool.Update {
+ private DiskPoolInner innerObject;
+
+ private final StoragePoolManager 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 SystemMetadata systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningStates provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public List availabilityZones() {
+ List inner = this.innerModel().availabilityZones();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public OperationalStatus status() {
+ return this.innerModel().status();
+ }
+
+ public List disks() {
+ List inner = this.innerModel().disks();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public String subnetId() {
+ return this.innerModel().subnetId();
+ }
+
+ public List additionalCapabilities() {
+ List inner = this.innerModel().additionalCapabilities();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public DiskPoolTier tier() {
+ return this.innerModel().tier();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public DiskPoolInner innerModel() {
+ return this.innerObject;
+ }
+
+ private StoragePoolManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String diskPoolName;
+
+ private DiskPoolCreate createDiskPoolCreatePayload;
+
+ private DiskPoolUpdate updateDiskPoolUpdatePayload;
+
+ public DiskPoolImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public DiskPool create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getDiskPools()
+ .createOrUpdate(resourceGroupName, diskPoolName, createDiskPoolCreatePayload, Context.NONE);
+ return this;
+ }
+
+ public DiskPool create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getDiskPools()
+ .createOrUpdate(resourceGroupName, diskPoolName, createDiskPoolCreatePayload, context);
+ return this;
+ }
+
+ DiskPoolImpl(String name, StoragePoolManager serviceManager) {
+ this.innerObject = new DiskPoolInner();
+ this.serviceManager = serviceManager;
+ this.diskPoolName = name;
+ this.createDiskPoolCreatePayload = new DiskPoolCreate();
+ }
+
+ public DiskPoolImpl update() {
+ this.updateDiskPoolUpdatePayload = new DiskPoolUpdate();
+ return this;
+ }
+
+ public DiskPool apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getDiskPools()
+ .update(resourceGroupName, diskPoolName, updateDiskPoolUpdatePayload, Context.NONE);
+ return this;
+ }
+
+ public DiskPool apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getDiskPools()
+ .update(resourceGroupName, diskPoolName, updateDiskPoolUpdatePayload, context);
+ return this;
+ }
+
+ DiskPoolImpl(DiskPoolInner innerObject, StoragePoolManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.diskPoolName = Utils.getValueFromIdByName(innerObject.id(), "diskPools");
+ }
+
+ public DiskPool refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getDiskPools()
+ .getByResourceGroupWithResponse(resourceGroupName, diskPoolName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public DiskPool refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getDiskPools()
+ .getByResourceGroupWithResponse(resourceGroupName, diskPoolName, context)
+ .getValue();
+ return this;
+ }
+
+ public DiskPoolImpl withRegion(Region location) {
+ this.createDiskPoolCreatePayload.withLocation(location.toString());
+ return this;
+ }
+
+ public DiskPoolImpl withRegion(String location) {
+ this.createDiskPoolCreatePayload.withLocation(location);
+ return this;
+ }
+
+ public DiskPoolImpl withAvailabilityZones(List availabilityZones) {
+ this.createDiskPoolCreatePayload.withAvailabilityZones(availabilityZones);
+ return this;
+ }
+
+ public DiskPoolImpl withSubnetId(String subnetId) {
+ this.createDiskPoolCreatePayload.withSubnetId(subnetId);
+ return this;
+ }
+
+ public DiskPoolImpl withTier(DiskPoolTier tier) {
+ this.createDiskPoolCreatePayload.withTier(tier);
+ return this;
+ }
+
+ public DiskPoolImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.createDiskPoolCreatePayload.withTags(tags);
+ return this;
+ } else {
+ this.updateDiskPoolUpdatePayload.withTags(tags);
+ return this;
+ }
+ }
+
+ public DiskPoolImpl withDisks(List disks) {
+ if (isInCreateMode()) {
+ this.createDiskPoolCreatePayload.withDisks(disks);
+ return this;
+ } else {
+ this.updateDiskPoolUpdatePayload.withDisks(disks);
+ return this;
+ }
+ }
+
+ public DiskPoolImpl withAdditionalCapabilities(List additionalCapabilities) {
+ this.createDiskPoolCreatePayload.withAdditionalCapabilities(additionalCapabilities);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsClientImpl.java
new file mode 100644
index 0000000000000..f135d1b240d42
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsClientImpl.java
@@ -0,0 +1,1534 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.storagepool.fluent.DiskPoolsClient;
+import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner;
+import com.azure.resourcemanager.storagepool.models.DiskPoolCreate;
+import com.azure.resourcemanager.storagepool.models.DiskPoolListResult;
+import com.azure.resourcemanager.storagepool.models.DiskPoolUpdate;
+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 DiskPoolsClient. */
+public final class DiskPoolsClientImpl implements DiskPoolsClient {
+ private final ClientLogger logger = new ClientLogger(DiskPoolsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final DiskPoolsService service;
+
+ /** The service client containing this operation class. */
+ private final StoragePoolManagementImpl client;
+
+ /**
+ * Initializes an instance of DiskPoolsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DiskPoolsClientImpl(StoragePoolManagementImpl client) {
+ this.service =
+ RestProxy.create(DiskPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StoragePoolManagementDiskPools to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StoragePoolManagemen")
+ private interface DiskPoolsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StoragePool/diskPools")
+ @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.StoragePool"
+ + "/diskPools")
+ @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.StoragePool"
+ + "/diskPools/{diskPoolName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") DiskPoolCreate diskPoolCreatePayload,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") DiskPoolUpdate diskPoolUpdatePayload,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @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 Disk Pools 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 Disk Pools in a subscription.
+ */
+ @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))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a list of Disk Pools 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 Disk Pools in a subscription.
+ */
+ @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 Disk Pools 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 Disk Pools in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of Disk Pools 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 Disk Pools in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of Disk Pools 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 Disk Pools in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets a list of Disk Pools 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 Disk Pools in a subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Gets a list of DiskPools 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 DiskPools in a resource group.
+ */
+ @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))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a list of DiskPools 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 DiskPools in a resource group.
+ */
+ @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 DiskPools 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 DiskPools in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of DiskPools 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 DiskPools in a resource group.
+ */
+ @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 DiskPools 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 DiskPools in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Gets a list of DiskPools 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 DiskPools in a resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (diskPoolCreatePayload == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter diskPoolCreatePayload is required and cannot be null."));
+ } else {
+ diskPoolCreatePayload.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ diskPoolCreatePayload,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (diskPoolCreatePayload == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter diskPoolCreatePayload is required and cannot be null."));
+ } else {
+ diskPoolCreatePayload.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ diskPoolCreatePayload,
+ accept,
+ context);
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, DiskPoolInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, Context.NONE);
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, DiskPoolInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, context);
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, DiskPoolInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) {
+ return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload).getSyncPoller();
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, DiskPoolInner> beginCreateOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) {
+ return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiskPoolInner createOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload) {
+ return createOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload).block();
+ }
+
+ /**
+ * Create or Update Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolCreatePayload Request payload for Disk pool create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiskPoolInner createOrUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolCreate diskPoolCreatePayload, Context context) {
+ return createOrUpdateAsync(resourceGroupName, diskPoolName, diskPoolCreatePayload, context).block();
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (diskPoolUpdatePayload == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter diskPoolUpdatePayload is required and cannot be null."));
+ } else {
+ diskPoolUpdatePayload.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ diskPoolUpdatePayload,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (diskPoolUpdatePayload == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter diskPoolUpdatePayload is required and cannot be null."));
+ } else {
+ diskPoolUpdatePayload.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ diskPoolUpdatePayload,
+ accept,
+ context);
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, DiskPoolInner> beginUpdateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) {
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, Context.NONE);
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, DiskPoolInner> beginUpdateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), DiskPoolInner.class, DiskPoolInner.class, context);
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, DiskPoolInner> beginUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload).getSyncPoller();
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, DiskPoolInner> beginUpdate(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context).getSyncPoller();
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiskPoolInner update(String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload) {
+ return updateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload).block();
+ }
+
+ /**
+ * Update a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param diskPoolUpdatePayload Request payload for Disk pool update operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for Disk pool request.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiskPoolInner update(
+ String resourceGroupName, String diskPoolName, DiskPoolUpdate diskPoolUpdatePayload, Context context) {
+ return updateAsync(resourceGroupName, diskPoolName, diskPoolUpdatePayload, context).block();
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String diskPoolName) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String diskPoolName, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName 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,
+ diskPoolName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String diskPoolName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskPoolName);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String diskPoolName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, diskPoolName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String diskPoolName) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String diskPoolName, Context context) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String diskPoolName) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String diskPoolName, Context context) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 diskPoolName) {
+ deleteAsync(resourceGroupName, diskPoolName).block();
+ }
+
+ /**
+ * Delete a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 diskPoolName, Context context) {
+ deleteAsync(resourceGroupName, diskPoolName, context).block();
+ }
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String diskPoolName) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String diskPoolName, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName 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,
+ diskPoolName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String diskPoolName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, diskPoolName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DiskPoolInner getByResourceGroup(String resourceGroupName, String diskPoolName) {
+ return getByResourceGroupAsync(resourceGroupName, diskPoolName).block();
+ }
+
+ /**
+ * Get a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String diskPoolName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, diskPoolName, 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 Disk Pools.
+ */
+ @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))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * 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 Disk Pools.
+ */
+ @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 Disk Pools.
+ */
+ @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))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * 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 Disk Pools.
+ */
+ @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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsImpl.java
new file mode 100644
index 0000000000000..78d4f275e3820
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/DiskPoolsImpl.java
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.storagepool.StoragePoolManager;
+import com.azure.resourcemanager.storagepool.fluent.DiskPoolsClient;
+import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolInner;
+import com.azure.resourcemanager.storagepool.models.DiskPool;
+import com.azure.resourcemanager.storagepool.models.DiskPools;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class DiskPoolsImpl implements DiskPools {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(DiskPoolsImpl.class);
+
+ private final DiskPoolsClient innerClient;
+
+ private final StoragePoolManager serviceManager;
+
+ public DiskPoolsImpl(DiskPoolsClient innerClient, StoragePoolManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return inner.mapPage(inner1 -> new DiskPoolImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return inner.mapPage(inner1 -> new DiskPoolImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return inner.mapPage(inner1 -> new DiskPoolImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return inner.mapPage(inner1 -> new DiskPoolImpl(inner1, this.manager()));
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String diskPoolName) {
+ this.serviceClient().delete(resourceGroupName, diskPoolName);
+ }
+
+ public void delete(String resourceGroupName, String diskPoolName, Context context) {
+ this.serviceClient().delete(resourceGroupName, diskPoolName, context);
+ }
+
+ public DiskPool getByResourceGroup(String resourceGroupName, String diskPoolName) {
+ DiskPoolInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, diskPoolName);
+ if (inner != null) {
+ return new DiskPoolImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String diskPoolName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, diskPoolName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new DiskPoolImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public DiskPool 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, diskPoolName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, diskPoolName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ this.delete(resourceGroupName, diskPoolName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ this.delete(resourceGroupName, diskPoolName, context);
+ }
+
+ private DiskPoolsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private StoragePoolManager manager() {
+ return this.serviceManager;
+ }
+
+ public DiskPoolImpl define(String name) {
+ return new DiskPoolImpl(name, this.manager());
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetImpl.java
new file mode 100644
index 0000000000000..dd2894148776f
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetImpl.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.storagepool.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.storagepool.StoragePoolManager;
+import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner;
+import com.azure.resourcemanager.storagepool.models.IscsiTarget;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetCreate;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetUpdate;
+import com.azure.resourcemanager.storagepool.models.OperationalStatus;
+import com.azure.resourcemanager.storagepool.models.ProvisioningStates;
+import com.azure.resourcemanager.storagepool.models.TargetPortalGroup;
+import com.azure.resourcemanager.storagepool.models.TargetPortalGroupCreate;
+import com.azure.resourcemanager.storagepool.models.TargetPortalGroupUpdate;
+import java.util.Collections;
+import java.util.List;
+
+public final class IscsiTargetImpl implements IscsiTarget, IscsiTarget.Definition, IscsiTarget.Update {
+ private IscsiTargetInner innerObject;
+
+ private final StoragePoolManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public ProvisioningStates provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public OperationalStatus status() {
+ return this.innerModel().status();
+ }
+
+ public List tpgs() {
+ List inner = this.innerModel().tpgs();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public String targetIqn() {
+ return this.innerModel().targetIqn();
+ }
+
+ public IscsiTargetInner innerModel() {
+ return this.innerObject;
+ }
+
+ private StoragePoolManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String diskPoolName;
+
+ private String iscsiTargetName;
+
+ private IscsiTargetCreate createIscsiTargetCreatePayload;
+
+ private IscsiTargetUpdate updateIscsiTargetUpdatePayload;
+
+ public IscsiTargetImpl withExistingDiskPool(String resourceGroupName, String diskPoolName) {
+ this.resourceGroupName = resourceGroupName;
+ this.diskPoolName = diskPoolName;
+ return this;
+ }
+
+ public IscsiTarget create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getIscsiTargets()
+ .createOrUpdate(
+ resourceGroupName, diskPoolName, iscsiTargetName, createIscsiTargetCreatePayload, Context.NONE);
+ return this;
+ }
+
+ public IscsiTarget create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getIscsiTargets()
+ .createOrUpdate(
+ resourceGroupName, diskPoolName, iscsiTargetName, createIscsiTargetCreatePayload, context);
+ return this;
+ }
+
+ IscsiTargetImpl(String name, StoragePoolManager serviceManager) {
+ this.innerObject = new IscsiTargetInner();
+ this.serviceManager = serviceManager;
+ this.iscsiTargetName = name;
+ this.createIscsiTargetCreatePayload = new IscsiTargetCreate();
+ }
+
+ public IscsiTargetImpl update() {
+ this.updateIscsiTargetUpdatePayload = new IscsiTargetUpdate();
+ return this;
+ }
+
+ public IscsiTarget apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getIscsiTargets()
+ .update(resourceGroupName, diskPoolName, iscsiTargetName, updateIscsiTargetUpdatePayload, Context.NONE);
+ return this;
+ }
+
+ public IscsiTarget apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getIscsiTargets()
+ .update(resourceGroupName, diskPoolName, iscsiTargetName, updateIscsiTargetUpdatePayload, context);
+ return this;
+ }
+
+ IscsiTargetImpl(IscsiTargetInner innerObject, StoragePoolManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.diskPoolName = Utils.getValueFromIdByName(innerObject.id(), "diskPools");
+ this.iscsiTargetName = Utils.getValueFromIdByName(innerObject.id(), "iscsiTargets");
+ }
+
+ public IscsiTarget refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getIscsiTargets()
+ .getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public IscsiTarget refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getIscsiTargets()
+ .getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, context)
+ .getValue();
+ return this;
+ }
+
+ public IscsiTargetImpl withTpgs(List tpgs) {
+ this.createIscsiTargetCreatePayload.withTpgs(tpgs);
+ return this;
+ }
+
+ public IscsiTargetImpl withTargetIqn(String targetIqn) {
+ this.createIscsiTargetCreatePayload.withTargetIqn(targetIqn);
+ return this;
+ }
+
+ public IscsiTargetImpl withTpgsForUpdate(List tpgs) {
+ this.updateIscsiTargetUpdatePayload.withTpgs(tpgs);
+ return this;
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsClientImpl.java
new file mode 100644
index 0000000000000..54c70ea21e132
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsClientImpl.java
@@ -0,0 +1,1486 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.storagepool.fluent.IscsiTargetsClient;
+import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetCreate;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetList;
+import com.azure.resourcemanager.storagepool.models.IscsiTargetUpdate;
+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 IscsiTargetsClient. */
+public final class IscsiTargetsClientImpl implements IscsiTargetsClient {
+ private final ClientLogger logger = new ClientLogger(IscsiTargetsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final IscsiTargetsService service;
+
+ /** The service client containing this operation class. */
+ private final StoragePoolManagementImpl client;
+
+ /**
+ * Initializes an instance of IscsiTargetsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ IscsiTargetsClientImpl(StoragePoolManagementImpl client) {
+ this.service =
+ RestProxy.create(IscsiTargetsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StoragePoolManagementIscsiTargets to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StoragePoolManagemen")
+ private interface IscsiTargetsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}/iscsiTargets")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByDiskPool(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @PathParam("iscsiTargetName") String iscsiTargetName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") IscsiTargetCreate iscsiTargetCreatePayload,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @PathParam("iscsiTargetName") String iscsiTargetName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") IscsiTargetUpdate iscsiTargetUpdatePayload,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @PathParam("iscsiTargetName") String iscsiTargetName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StoragePool"
+ + "/diskPools/{diskPoolName}/iscsiTargets/{iscsiTargetName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("diskPoolName") String diskPoolName,
+ @PathParam("iscsiTargetName") String iscsiTargetName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByDiskPoolNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByDiskPoolSinglePageAsync(
+ String resourceGroupName, String diskPoolName) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByDiskPool(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByDiskPoolSinglePageAsync(
+ String resourceGroupName, String diskPoolName, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByDiskPool(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByDiskPoolAsync(String resourceGroupName, String diskPoolName) {
+ return new PagedFlux<>(
+ () -> listByDiskPoolSinglePageAsync(resourceGroupName, diskPoolName),
+ nextLink -> listByDiskPoolNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByDiskPoolAsync(
+ String resourceGroupName, String diskPoolName, Context context) {
+ return new PagedFlux<>(
+ () -> listByDiskPoolSinglePageAsync(resourceGroupName, diskPoolName, context),
+ nextLink -> listByDiskPoolNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName) {
+ return new PagedIterable<>(listByDiskPoolAsync(resourceGroupName, diskPoolName));
+ }
+
+ /**
+ * Get iSCSI Targets in a Disk pool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return iSCSI Targets in a Disk pool.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByDiskPool(
+ String resourceGroupName, String diskPoolName, Context context) {
+ return new PagedIterable<>(listByDiskPoolAsync(resourceGroupName, diskPoolName, context));
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ if (iscsiTargetCreatePayload == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter iscsiTargetCreatePayload is required and cannot be null."));
+ } else {
+ iscsiTargetCreatePayload.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ iscsiTargetCreatePayload,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ if (iscsiTargetCreatePayload == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter iscsiTargetCreatePayload is required and cannot be null."));
+ } else {
+ iscsiTargetCreatePayload.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ iscsiTargetCreatePayload,
+ accept,
+ context);
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, IscsiTargetInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, Context.NONE);
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, IscsiTargetInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(
+ resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, context);
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, IscsiTargetInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload) {
+ return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, IscsiTargetInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ Context context) {
+ return beginCreateOrUpdateAsync(
+ resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload) {
+ return beginCreateOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ Context context) {
+ return beginCreateOrUpdateAsync(
+ resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public IscsiTargetInner createOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload) {
+ return createOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload).block();
+ }
+
+ /**
+ * Create or Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetCreatePayload Request payload for iSCSI target create operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public IscsiTargetInner createOrUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetCreate iscsiTargetCreatePayload,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetCreatePayload, context)
+ .block();
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ if (iscsiTargetUpdatePayload == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter iscsiTargetUpdatePayload is required and cannot be null."));
+ } else {
+ iscsiTargetUpdatePayload.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ iscsiTargetUpdatePayload,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ if (iscsiTargetUpdatePayload == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter iscsiTargetUpdatePayload is required and cannot be null."));
+ } else {
+ iscsiTargetUpdatePayload.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ iscsiTargetUpdatePayload,
+ accept,
+ context);
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, IscsiTargetInner> beginUpdateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload) {
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, Context.NONE);
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, IscsiTargetInner> beginUpdateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(
+ resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), IscsiTargetInner.class, IscsiTargetInner.class, context);
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, IscsiTargetInner> beginUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload)
+ .getSyncPoller();
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, IscsiTargetInner> beginUpdate(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target operations.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public IscsiTargetInner update(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload) {
+ return updateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload).block();
+ }
+
+ /**
+ * Update an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param iscsiTargetUpdatePayload Request payload for iSCSI target 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 response for iSCSI target requests.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public IscsiTargetInner update(
+ String resourceGroupName,
+ String diskPoolName,
+ String iscsiTargetName,
+ IscsiTargetUpdate iscsiTargetUpdatePayload,
+ Context context) {
+ return updateAsync(resourceGroupName, diskPoolName, iscsiTargetName, iscsiTargetUpdatePayload, context).block();
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName 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,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName).getSyncPoller();
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) {
+ return beginDeleteAsync(resourceGroupName, diskPoolName, iscsiTargetName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 diskPoolName, String iscsiTargetName) {
+ deleteAsync(resourceGroupName, diskPoolName, iscsiTargetName).block();
+ }
+
+ /**
+ * Delete an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 diskPoolName, String iscsiTargetName, Context context) {
+ deleteAsync(resourceGroupName, diskPoolName, iscsiTargetName, context).block();
+ }
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, 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 (diskPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter diskPoolName is required and cannot be null."));
+ }
+ if (iscsiTargetName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter iscsiTargetName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ diskPoolName,
+ iscsiTargetName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ return getWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public IscsiTargetInner get(String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ return getAsync(resourceGroupName, diskPoolName, iscsiTargetName).block();
+ }
+
+ /**
+ * Get an iSCSI target.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param diskPoolName The name of the Disk pool.
+ * @param iscsiTargetName The name of the iSCSI target.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 iSCSI target.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) {
+ return getWithResponseAsync(resourceGroupName, diskPoolName, iscsiTargetName, 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 iSCSI Targets.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByDiskPoolNextSinglePageAsync(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.listByDiskPoolNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * 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 iSCSI Targets.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByDiskPoolNextSinglePageAsync(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
+ .listByDiskPoolNext(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/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsImpl.java
new file mode 100644
index 0000000000000..461dc91fda9cf
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/IscsiTargetsImpl.java
@@ -0,0 +1,189 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.storagepool.StoragePoolManager;
+import com.azure.resourcemanager.storagepool.fluent.IscsiTargetsClient;
+import com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner;
+import com.azure.resourcemanager.storagepool.models.IscsiTarget;
+import com.azure.resourcemanager.storagepool.models.IscsiTargets;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class IscsiTargetsImpl implements IscsiTargets {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(IscsiTargetsImpl.class);
+
+ private final IscsiTargetsClient innerClient;
+
+ private final StoragePoolManager serviceManager;
+
+ public IscsiTargetsImpl(IscsiTargetsClient innerClient, StoragePoolManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName) {
+ PagedIterable inner = this.serviceClient().listByDiskPool(resourceGroupName, diskPoolName);
+ return inner.mapPage(inner1 -> new IscsiTargetImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByDiskPool(String resourceGroupName, String diskPoolName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByDiskPool(resourceGroupName, diskPoolName, context);
+ return inner.mapPage(inner1 -> new IscsiTargetImpl(inner1, this.manager()));
+ }
+
+ public void delete(String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ this.serviceClient().delete(resourceGroupName, diskPoolName, iscsiTargetName);
+ }
+
+ public void delete(String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) {
+ this.serviceClient().delete(resourceGroupName, diskPoolName, iscsiTargetName, context);
+ }
+
+ public IscsiTarget get(String resourceGroupName, String diskPoolName, String iscsiTargetName) {
+ IscsiTargetInner inner = this.serviceClient().get(resourceGroupName, diskPoolName, iscsiTargetName);
+ if (inner != null) {
+ return new IscsiTargetImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String diskPoolName, String iscsiTargetName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new IscsiTargetImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public IscsiTarget 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets");
+ if (iscsiTargetName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets");
+ if (iscsiTargetName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, diskPoolName, iscsiTargetName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets");
+ if (iscsiTargetName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id)));
+ }
+ this.delete(resourceGroupName, diskPoolName, iscsiTargetName, 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 diskPoolName = Utils.getValueFromIdByName(id, "diskPools");
+ if (diskPoolName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'diskPools'.", id)));
+ }
+ String iscsiTargetName = Utils.getValueFromIdByName(id, "iscsiTargets");
+ if (iscsiTargetName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'iscsiTargets'.", id)));
+ }
+ this.delete(resourceGroupName, diskPoolName, iscsiTargetName, context);
+ }
+
+ private IscsiTargetsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private StoragePoolManager manager() {
+ return this.serviceManager;
+ }
+
+ public IscsiTargetImpl define(String name) {
+ return new IscsiTargetImpl(name, this.manager());
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsClientImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..9d8eb1ff28c8e
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsClientImpl.java
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagepool.fluent.OperationsClient;
+import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner;
+import com.azure.resourcemanager.storagepool.models.StoragePoolOperationListResult;
+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 {
+ private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final OperationsService service;
+
+ /** The service client containing this operation class. */
+ private final StoragePoolManagementImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(StoragePoolManagementImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StoragePoolManagementOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StoragePoolManagemen")
+ private interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.StoragePool/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 StoragePool 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 StoragePool operations.
+ */
+ @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))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a list of StoragePool 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 StoragePool operations.
+ */
+ @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 StoragePool 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 StoragePool operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync());
+ }
+
+ /**
+ * Gets a list of StoragePool 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 StoragePool operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context));
+ }
+
+ /**
+ * Gets a list of StoragePool 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 StoragePool operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets a list of StoragePool 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 StoragePool operations.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..357bde60bf94b
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/OperationsImpl.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.storagepool.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.storagepool.StoragePoolManager;
+import com.azure.resourcemanager.storagepool.fluent.OperationsClient;
+import com.azure.resourcemanager.storagepool.fluent.models.StoragePoolRPOperationInner;
+import com.azure.resourcemanager.storagepool.models.Operations;
+import com.azure.resourcemanager.storagepool.models.StoragePoolRPOperation;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class OperationsImpl implements Operations {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final StoragePoolManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient, StoragePoolManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return inner.mapPage(inner1 -> new StoragePoolRPOperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return inner.mapPage(inner1 -> new StoragePoolRPOperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private StoragePoolManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementBuilder.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementBuilder.java
new file mode 100644
index 0000000000000..3b68aad879b0d
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementBuilder.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.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.CookiePolicy;
+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 StoragePoolManagementImpl type. */
+@ServiceClientBuilder(serviceClients = {StoragePoolManagementImpl.class})
+public final class StoragePoolManagementBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the StoragePoolManagementBuilder.
+ */
+ public StoragePoolManagementBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the StoragePoolManagementBuilder.
+ */
+ public StoragePoolManagementBuilder 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 StoragePoolManagementBuilder.
+ */
+ public StoragePoolManagementBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ 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 StoragePoolManagementBuilder.
+ */
+ public StoragePoolManagementBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ 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 StoragePoolManagementBuilder.
+ */
+ public StoragePoolManagementBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ 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 StoragePoolManagementBuilder.
+ */
+ public StoragePoolManagementBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of StoragePoolManagementImpl with the provided parameters.
+ *
+ * @return an instance of StoragePoolManagementImpl.
+ */
+ public StoragePoolManagementImpl buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ if (pipeline == null) {
+ this.pipeline =
+ new HttpPipelineBuilder()
+ .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
+ .build();
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
+ }
+ StoragePoolManagementImpl client =
+ new StoragePoolManagementImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementImpl.java b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementImpl.java
new file mode 100644
index 0000000000000..6fd794776b5ac
--- /dev/null
+++ b/sdk/storagepool/azure-resourcemanager-storagepool/src/main/java/com/azure/resourcemanager/storagepool/implementation/StoragePoolManagementImpl.java
@@ -0,0 +1,321 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagepool.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.storagepool.fluent.DiskPoolsClient;
+import com.azure.resourcemanager.storagepool.fluent.IscsiTargetsClient;
+import com.azure.resourcemanager.storagepool.fluent.OperationsClient;
+import com.azure.resourcemanager.storagepool.fluent.StoragePoolManagement;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import java.util.Map;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the StoragePoolManagementImpl type. */
+@ServiceClient(builder = StoragePoolManagementBuilder.class)
+public final class StoragePoolManagementImpl implements StoragePoolManagement {
+ private final ClientLogger logger = new ClientLogger(StoragePoolManagementImpl.class);
+
+ /** 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 DiskPoolsClient object to access its operations. */
+ private final DiskPoolsClient diskPools;
+
+ /**
+ * Gets the DiskPoolsClient object to access its operations.
+ *
+ * @return the DiskPoolsClient object.
+ */
+ public DiskPoolsClient getDiskPools() {
+ return this.diskPools;
+ }
+
+ /** The IscsiTargetsClient object to access its operations. */
+ private final IscsiTargetsClient iscsiTargets;
+
+ /**
+ * Gets the IscsiTargetsClient object to access its operations.
+ *
+ * @return the IscsiTargetsClient object.
+ */
+ public IscsiTargetsClient getIscsiTargets() {
+ return this.iscsiTargets;
+ }
+
+ /**
+ * Initializes an instance of StoragePoolManagement 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.
+ */
+ StoragePoolManagementImpl(
+ 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 = "2020-03-15-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.diskPools = new DiskPoolsClientImpl(this);
+ this.iscsiTargets = new IscsiTargetsClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ for (Map.Entry