scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval =
+ Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of StorageTasks service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the StorageTasks service API instance.
+ */
+ public StorageTasksManager 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.storagetasks")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new StorageTasksManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * Gets the resource collection API of StorageTasks. It manages StorageTask.
+ *
+ * @return Resource collection API of StorageTasks.
+ */
+ public StorageTasks storageTasks() {
+ if (this.storageTasks == null) {
+ this.storageTasks = new StorageTasksImpl(clientObject.getStorageTasks(), this);
+ }
+ return storageTasks;
+ }
+
+ /**
+ * Gets the resource collection API of StorageTaskAssignments.
+ *
+ * @return Resource collection API of StorageTaskAssignments.
+ */
+ public StorageTaskAssignments storageTaskAssignments() {
+ if (this.storageTaskAssignments == null) {
+ this.storageTaskAssignments =
+ new StorageTaskAssignmentsImpl(clientObject.getStorageTaskAssignments(), this);
+ }
+ return storageTaskAssignments;
+ }
+
+ /**
+ * Gets the resource collection API of StorageTasksReports.
+ *
+ * @return Resource collection API of StorageTasksReports.
+ */
+ public StorageTasksReports storageTasksReports() {
+ if (this.storageTasksReports == null) {
+ this.storageTasksReports = new StorageTasksReportsImpl(clientObject.getStorageTasksReports(), this);
+ }
+ return storageTasksReports;
+ }
+
+ /**
+ * @return Wrapped service client StorageTasksManagementClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ */
+ public StorageTasksManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/OperationsClient.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/OperationsClient.java
new file mode 100644
index 000000000000..e80ca8ec4b90
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/OperationsClient.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTaskAssignmentsClient.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTaskAssignmentsClient.java
new file mode 100644
index 000000000000..4878462d8480
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTaskAssignmentsClient.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.storagetasks.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.storagetasks.fluent.models.StorageTaskAssignmentInner;
+
+/** An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. */
+public interface StorageTaskAssignmentsClient {
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String storageTaskName);
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String storageTaskName, String maxpagesize, Context context);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksClient.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksClient.java
new file mode 100644
index 000000000000..b294cee40a2d
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksClient.java
@@ -0,0 +1,320 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.models.StorageTaskInner;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskPreviewActionInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskUpdateParameters;
+
+/** An instance of this class provides access to all the operations defined in StorageTasksClient. */
+public interface StorageTasksClient {
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, StorageTaskInner> beginCreate(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters);
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, StorageTaskInner> beginCreate(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context);
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @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 represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters);
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @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 represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StorageTaskInner create(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context);
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName);
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName, Context context);
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storageTaskName);
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storageTaskName, Context context);
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storage task properties along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String storageTaskName, Context context);
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storage task properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName);
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, StorageTaskInner> beginUpdate(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters);
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, StorageTaskInner> beginUpdate(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context);
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @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 represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters);
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @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 represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StorageTaskInner update(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context);
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @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 storage Task Preview Action along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response previewActionsWithResponse(
+ StorageTaskPreviewActionInner parameters, Context context);
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @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 storage Task Preview Action.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ StorageTaskPreviewActionInner previewActions(StorageTaskPreviewActionInner parameters);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksManagementClient.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksManagementClient.java
new file mode 100644
index 000000000000..dc8ea2e2cde2
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksManagementClient.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for StorageTasksManagementClient class. */
+public interface StorageTasksManagementClient {
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @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 StorageTasksClient object to access its operations.
+ *
+ * @return the StorageTasksClient object.
+ */
+ StorageTasksClient getStorageTasks();
+
+ /**
+ * Gets the StorageTaskAssignmentsClient object to access its operations.
+ *
+ * @return the StorageTaskAssignmentsClient object.
+ */
+ StorageTaskAssignmentsClient getStorageTaskAssignments();
+
+ /**
+ * Gets the StorageTasksReportsClient object to access its operations.
+ *
+ * @return the StorageTasksReportsClient object.
+ */
+ StorageTasksReportsClient getStorageTasksReports();
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksReportsClient.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksReportsClient.java
new file mode 100644
index 000000000000..d35633a59354
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/StorageTasksReportsClient.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.models.StorageTaskReportInstanceInner;
+
+/** An instance of this class provides access to all the operations defined in StorageTasksReportsClient. */
+public interface StorageTasksReportsClient {
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String storageTaskName);
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @param filter Optional. When specified, it can be used to query using reporting properties.
+ * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter, Context context);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/OperationInner.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..d89f976d55d3
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/OperationInner.java
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.storagetasks.models.ActionType;
+import com.azure.resourcemanager.storagetasks.models.OperationDisplay;
+import com.azure.resourcemanager.storagetasks.models.Origin;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
+ * ARM/control-plane operations.
+ */
+ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY)
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ @JsonProperty(value = "display")
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ * value is "user,system"
+ */
+ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
+ private Origin origin;
+
+ /*
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY)
+ private ActionType actionType;
+
+ /** Creates an instance of OperationInner class. */
+ public OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for ARM/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskAssignmentInner.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskAssignmentInner.java
new file mode 100644
index 000000000000..8a6d86f4d680
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskAssignmentInner.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Fetch the Storage task assignment ARM ids. */
+@Immutable
+public final class StorageTaskAssignmentInner {
+ /*
+ * ARM Id of the storage task assignments, associated with the storage tasks.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /** Creates an instance of StorageTaskAssignmentInner class. */
+ public StorageTaskAssignmentInner() {
+ }
+
+ /**
+ * Get the id property: ARM Id of the storage task assignments, associated with the storage tasks.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskInner.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskInner.java
new file mode 100644
index 000000000000..17ad0a1db969
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskInner.java
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.storagetasks.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.storagetasks.models.ProvisioningState;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAction;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+import java.util.Map;
+
+/** Represents Storage Task. */
+@Fluent
+public final class StorageTaskInner extends Resource {
+ /*
+ * The managed service identity of the resource.
+ */
+ @JsonProperty(value = "identity")
+ private ManagedServiceIdentity identity;
+
+ /*
+ * Properties of the storage task.
+ */
+ @JsonProperty(value = "properties")
+ private StorageTaskProperties innerProperties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of StorageTaskInner class. */
+ public StorageTaskInner() {
+ }
+
+ /**
+ * Get the identity property: The managed service identity of the resource.
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The managed service identity of the resource.
+ *
+ * @param identity the identity value to set.
+ * @return the StorageTaskInner object itself.
+ */
+ public StorageTaskInner withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the innerProperties property: Properties of the storage task.
+ *
+ * @return the innerProperties value.
+ */
+ private StorageTaskProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public StorageTaskInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public StorageTaskInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the taskVersion property: Storage task version.
+ *
+ * @return the taskVersion value.
+ */
+ public Long taskVersion() {
+ return this.innerProperties() == null ? null : this.innerProperties().taskVersion();
+ }
+
+ /**
+ * Get the enabled property: Storage Task is enabled when set to true and disabled when set to false.
+ *
+ * @return the enabled value.
+ */
+ public Boolean enabled() {
+ return this.innerProperties() == null ? null : this.innerProperties().enabled();
+ }
+
+ /**
+ * Set the enabled property: Storage Task is enabled when set to true and disabled when set to false.
+ *
+ * @param enabled the enabled value to set.
+ * @return the StorageTaskInner object itself.
+ */
+ public StorageTaskInner withEnabled(Boolean enabled) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new StorageTaskProperties();
+ }
+ this.innerProperties().withEnabled(enabled);
+ return this;
+ }
+
+ /**
+ * Get the description property: Text that describes the purpose of the storage task.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.innerProperties() == null ? null : this.innerProperties().description();
+ }
+
+ /**
+ * Set the description property: Text that describes the purpose of the storage task.
+ *
+ * @param description the description value to set.
+ * @return the StorageTaskInner object itself.
+ */
+ public StorageTaskInner withDescription(String description) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new StorageTaskProperties();
+ }
+ this.innerProperties().withDescription(description);
+ return this;
+ }
+
+ /**
+ * Get the action property: The storage task action that is executed.
+ *
+ * @return the action value.
+ */
+ public StorageTaskAction action() {
+ return this.innerProperties() == null ? null : this.innerProperties().action();
+ }
+
+ /**
+ * Set the action property: The storage task action that is executed.
+ *
+ * @param action the action value to set.
+ * @return the StorageTaskInner object itself.
+ */
+ public StorageTaskInner withAction(StorageTaskAction action) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new StorageTaskProperties();
+ }
+ this.innerProperties().withAction(action);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Represents the provisioning state of the storage task.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the creationTimeInUtc property: The creation date and time of the storage task in UTC.
+ *
+ * @return the creationTimeInUtc value.
+ */
+ public OffsetDateTime creationTimeInUtc() {
+ return this.innerProperties() == null ? null : this.innerProperties().creationTimeInUtc();
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (innerProperties() != null) {
+ innerProperties().validate();
+ }
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskPreviewActionInner.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskPreviewActionInner.java
new file mode 100644
index 000000000000..09d2d0ee9dfb
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskPreviewActionInner.java
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewActionCondition;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewBlobProperties;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewContainerProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Storage Task Preview Action. */
+@Fluent
+public final class StorageTaskPreviewActionInner {
+ /*
+ * Properties of the storage task preview.
+ */
+ @JsonProperty(value = "properties", required = true)
+ private StorageTaskPreviewActionProperties innerProperties = new StorageTaskPreviewActionProperties();
+
+ /** Creates an instance of StorageTaskPreviewActionInner class. */
+ public StorageTaskPreviewActionInner() {
+ }
+
+ /**
+ * Get the innerProperties property: Properties of the storage task preview.
+ *
+ * @return the innerProperties value.
+ */
+ private StorageTaskPreviewActionProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /**
+ * Get the container property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @return the container value.
+ */
+ public StorageTaskPreviewContainerProperties container() {
+ return this.innerProperties() == null ? null : this.innerProperties().container();
+ }
+
+ /**
+ * Set the container property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @param container the container value to set.
+ * @return the StorageTaskPreviewActionInner object itself.
+ */
+ public StorageTaskPreviewActionInner withContainer(StorageTaskPreviewContainerProperties container) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new StorageTaskPreviewActionProperties();
+ }
+ this.innerProperties().withContainer(container);
+ return this;
+ }
+
+ /**
+ * Get the blobs property: Preview action container properties to be tested for a match with the provided condition.
+ *
+ * @return the blobs value.
+ */
+ public List blobs() {
+ return this.innerProperties() == null ? null : this.innerProperties().blobs();
+ }
+
+ /**
+ * Set the blobs property: Preview action container properties to be tested for a match with the provided condition.
+ *
+ * @param blobs the blobs value to set.
+ * @return the StorageTaskPreviewActionInner object itself.
+ */
+ public StorageTaskPreviewActionInner withBlobs(List blobs) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new StorageTaskPreviewActionProperties();
+ }
+ this.innerProperties().withBlobs(blobs);
+ return this;
+ }
+
+ /**
+ * Get the action property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @return the action value.
+ */
+ public StorageTaskPreviewActionCondition action() {
+ return this.innerProperties() == null ? null : this.innerProperties().action();
+ }
+
+ /**
+ * Set the action property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @param action the action value to set.
+ * @return the StorageTaskPreviewActionInner object itself.
+ */
+ public StorageTaskPreviewActionInner withAction(StorageTaskPreviewActionCondition action) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new StorageTaskPreviewActionProperties();
+ }
+ this.innerProperties().withAction(action);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (innerProperties() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property innerProperties in model StorageTaskPreviewActionInner"));
+ } else {
+ innerProperties().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTaskPreviewActionInner.class);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskPreviewActionProperties.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskPreviewActionProperties.java
new file mode 100644
index 000000000000..2f09ffada489
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskPreviewActionProperties.java
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewActionCondition;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewBlobProperties;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewContainerProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** Storage task preview action properties. */
+@Fluent
+public final class StorageTaskPreviewActionProperties {
+ /*
+ * Preview action container properties to be tested for a match with the provided condition.
+ */
+ @JsonProperty(value = "container", required = true)
+ private StorageTaskPreviewContainerProperties container;
+
+ /*
+ * Preview action container properties to be tested for a match with the provided condition.
+ */
+ @JsonProperty(value = "blobs", required = true)
+ private List blobs;
+
+ /*
+ * Preview action container properties to be tested for a match with the provided condition.
+ */
+ @JsonProperty(value = "action", required = true)
+ private StorageTaskPreviewActionCondition action;
+
+ /** Creates an instance of StorageTaskPreviewActionProperties class. */
+ public StorageTaskPreviewActionProperties() {
+ }
+
+ /**
+ * Get the container property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @return the container value.
+ */
+ public StorageTaskPreviewContainerProperties container() {
+ return this.container;
+ }
+
+ /**
+ * Set the container property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @param container the container value to set.
+ * @return the StorageTaskPreviewActionProperties object itself.
+ */
+ public StorageTaskPreviewActionProperties withContainer(StorageTaskPreviewContainerProperties container) {
+ this.container = container;
+ return this;
+ }
+
+ /**
+ * Get the blobs property: Preview action container properties to be tested for a match with the provided condition.
+ *
+ * @return the blobs value.
+ */
+ public List blobs() {
+ return this.blobs;
+ }
+
+ /**
+ * Set the blobs property: Preview action container properties to be tested for a match with the provided condition.
+ *
+ * @param blobs the blobs value to set.
+ * @return the StorageTaskPreviewActionProperties object itself.
+ */
+ public StorageTaskPreviewActionProperties withBlobs(List blobs) {
+ this.blobs = blobs;
+ return this;
+ }
+
+ /**
+ * Get the action property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @return the action value.
+ */
+ public StorageTaskPreviewActionCondition action() {
+ return this.action;
+ }
+
+ /**
+ * Set the action property: Preview action container properties to be tested for a match with the provided
+ * condition.
+ *
+ * @param action the action value to set.
+ * @return the StorageTaskPreviewActionProperties object itself.
+ */
+ public StorageTaskPreviewActionProperties withAction(StorageTaskPreviewActionCondition action) {
+ this.action = action;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (container() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property container in model StorageTaskPreviewActionProperties"));
+ } else {
+ container().validate();
+ }
+ if (blobs() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property blobs in model StorageTaskPreviewActionProperties"));
+ } else {
+ blobs().forEach(e -> e.validate());
+ }
+ if (action() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property action in model StorageTaskPreviewActionProperties"));
+ } else {
+ action().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTaskPreviewActionProperties.class);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskProperties.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskProperties.java
new file mode 100644
index 000000000000..7257c15c784f
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskProperties.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.storagetasks.models.ProvisioningState;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAction;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** Properties of the storage task. */
+@Fluent
+public final class StorageTaskProperties {
+ /*
+ * Storage task version.
+ */
+ @JsonProperty(value = "taskVersion", access = JsonProperty.Access.WRITE_ONLY)
+ private Long taskVersion;
+
+ /*
+ * Storage Task is enabled when set to true and disabled when set to false
+ */
+ @JsonProperty(value = "enabled", required = true)
+ private boolean enabled;
+
+ /*
+ * Text that describes the purpose of the storage task
+ */
+ @JsonProperty(value = "description", required = true)
+ private String description;
+
+ /*
+ * The storage task action that is executed
+ */
+ @JsonProperty(value = "action", required = true)
+ private StorageTaskAction action;
+
+ /*
+ * Represents the provisioning state of the storage task.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /*
+ * The creation date and time of the storage task in UTC.
+ */
+ @JsonProperty(value = "creationTimeInUtc", access = JsonProperty.Access.WRITE_ONLY)
+ private OffsetDateTime creationTimeInUtc;
+
+ /** Creates an instance of StorageTaskProperties class. */
+ public StorageTaskProperties() {
+ }
+
+ /**
+ * Get the taskVersion property: Storage task version.
+ *
+ * @return the taskVersion value.
+ */
+ public Long taskVersion() {
+ return this.taskVersion;
+ }
+
+ /**
+ * Get the enabled property: Storage Task is enabled when set to true and disabled when set to false.
+ *
+ * @return the enabled value.
+ */
+ public boolean enabled() {
+ return this.enabled;
+ }
+
+ /**
+ * Set the enabled property: Storage Task is enabled when set to true and disabled when set to false.
+ *
+ * @param enabled the enabled value to set.
+ * @return the StorageTaskProperties object itself.
+ */
+ public StorageTaskProperties withEnabled(boolean enabled) {
+ this.enabled = enabled;
+ return this;
+ }
+
+ /**
+ * Get the description property: Text that describes the purpose of the storage task.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Set the description property: Text that describes the purpose of the storage task.
+ *
+ * @param description the description value to set.
+ * @return the StorageTaskProperties object itself.
+ */
+ public StorageTaskProperties withDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Get the action property: The storage task action that is executed.
+ *
+ * @return the action value.
+ */
+ public StorageTaskAction action() {
+ return this.action;
+ }
+
+ /**
+ * Set the action property: The storage task action that is executed.
+ *
+ * @param action the action value to set.
+ * @return the StorageTaskProperties object itself.
+ */
+ public StorageTaskProperties withAction(StorageTaskAction action) {
+ this.action = action;
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: Represents the provisioning state of the storage task.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the creationTimeInUtc property: The creation date and time of the storage task in UTC.
+ *
+ * @return the creationTimeInUtc value.
+ */
+ public OffsetDateTime creationTimeInUtc() {
+ return this.creationTimeInUtc;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (description() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property description in model StorageTaskProperties"));
+ }
+ if (action() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property action in model StorageTaskProperties"));
+ } else {
+ action().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTaskProperties.class);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskReportInstanceInner.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskReportInstanceInner.java
new file mode 100644
index 000000000000..1a30e6914ab8
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/StorageTaskReportInstanceInner.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskReportProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Storage Tasks run report instance. */
+@Fluent
+public final class StorageTaskReportInstanceInner extends ProxyResource {
+ /*
+ * Storage task execution report for a run instance.
+ */
+ @JsonProperty(value = "properties")
+ private StorageTaskReportProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of StorageTaskReportInstanceInner class. */
+ public StorageTaskReportInstanceInner() {
+ }
+
+ /**
+ * Get the properties property: Storage task execution report for a run instance.
+ *
+ * @return the properties value.
+ */
+ public StorageTaskReportProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Storage task execution report for a run instance.
+ *
+ * @param properties the properties value to set.
+ * @return the StorageTaskReportInstanceInner object itself.
+ */
+ public StorageTaskReportInstanceInner withProperties(StorageTaskReportProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/package-info.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/package-info.java
new file mode 100644
index 000000000000..9a0a07b75125
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/models/package-info.java
@@ -0,0 +1,8 @@
+// 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 StorageTasksManagementClient. The Azure Storage Tasks Management API.
+ */
+package com.azure.resourcemanager.storagetasks.fluent.models;
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/package-info.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/fluent/package-info.java
new file mode 100644
index 000000000000..29a53d6edf3d
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/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 StorageTasksManagementClient. The Azure Storage Tasks Management API. */
+package com.azure.resourcemanager.storagetasks.fluent;
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationImpl.java
new file mode 100644
index 000000000000..20c1ebc833b3
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.resourcemanager.storagetasks.fluent.models.OperationInner;
+import com.azure.resourcemanager.storagetasks.models.ActionType;
+import com.azure.resourcemanager.storagetasks.models.Operation;
+import com.azure.resourcemanager.storagetasks.models.OperationDisplay;
+import com.azure.resourcemanager.storagetasks.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ OperationImpl(
+ OperationInner innerObject, com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationsClientImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..6f1b14cd1e5f
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationsClientImpl.java
@@ -0,0 +1,276 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.storagetasks.fluent.OperationsClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.OperationInner;
+import com.azure.resourcemanager.storagetasks.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public final class OperationsClientImpl implements OperationsClient {
+ /** The proxy service used to perform REST calls. */
+ private final OperationsService service;
+
+ /** The service client containing this operation class. */
+ private final StorageTasksManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(StorageTasksManagementClientImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StorageTasksManagementClientOperations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StorageTasksManageme")
+ public interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.StorageTasks/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Lists all of the available Storage Tasks Rest API 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 REST API operations supported by an Azure Resource Provider as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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
+ .listNext(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/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationsImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..acd2c791eb27
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.OperationsClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.OperationInner;
+import com.azure.resourcemanager.storagetasks.models.Operation;
+import com.azure.resourcemanager.storagetasks.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ public OperationsImpl(
+ OperationsClient innerClient, com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentImpl.java
new file mode 100644
index 000000000000..c7dddd70185a
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentImpl.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskAssignmentInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAssignment;
+
+public final class StorageTaskAssignmentImpl implements StorageTaskAssignment {
+ private StorageTaskAssignmentInner innerObject;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ StorageTaskAssignmentImpl(
+ StorageTaskAssignmentInner innerObject,
+ com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public StorageTaskAssignmentInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentsClientImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentsClientImpl.java
new file mode 100644
index 000000000000..d54d8316c56c
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentsClientImpl.java
@@ -0,0 +1,383 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTaskAssignmentsClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskAssignmentInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAssignmentsListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. */
+public final class StorageTaskAssignmentsClientImpl implements StorageTaskAssignmentsClient {
+ /** The proxy service used to perform REST calls. */
+ private final StorageTaskAssignmentsService service;
+
+ /** The service client containing this operation class. */
+ private final StorageTasksManagementClientImpl client;
+
+ /**
+ * Initializes an instance of StorageTaskAssignmentsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ StorageTaskAssignmentsClientImpl(StorageTasksManagementClientImpl client) {
+ this.service =
+ RestProxy
+ .create(StorageTaskAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StorageTasksManagementClientStorageTaskAssignments to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StorageTasksManageme")
+ public interface StorageTaskAssignmentsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks/{storageTaskName}/storageTaskAssignments")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("storageTaskName") String storageTaskName,
+ @QueryParam("$maxpagesize") String maxpagesize,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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(),
+ resourceGroupName,
+ storageTaskName,
+ maxpagesize,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @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 response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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(),
+ resourceGroupName,
+ storageTaskName,
+ maxpagesize,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String storageTaskName) {
+ final String maxpagesize = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @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 response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String storageTaskName) {
+ final String maxpagesize = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @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 response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String resourceGroupName, String storageTaskName, String maxpagesize, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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
+ .listNext(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/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentsImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentsImpl.java
new file mode 100644
index 000000000000..a5194b072981
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskAssignmentsImpl.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.StorageTaskAssignmentsClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskAssignmentInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAssignment;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAssignments;
+
+public final class StorageTaskAssignmentsImpl implements StorageTaskAssignments {
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentsImpl.class);
+
+ private final StorageTaskAssignmentsClient innerClient;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ public StorageTaskAssignmentsImpl(
+ StorageTaskAssignmentsClient innerClient,
+ com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String storageTaskName) {
+ PagedIterable inner = this.serviceClient().list(resourceGroupName, storageTaskName);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(
+ String resourceGroupName, String storageTaskName, String maxpagesize, Context context) {
+ PagedIterable inner =
+ this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, context);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager()));
+ }
+
+ private StorageTaskAssignmentsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskImpl.java
new file mode 100644
index 000000000000..4aad1d53793f
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskImpl.java
@@ -0,0 +1,251 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskInner;
+import com.azure.resourcemanager.storagetasks.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.storagetasks.models.ProvisioningState;
+import com.azure.resourcemanager.storagetasks.models.StorageTask;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskAction;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskUpdateParameters;
+import java.time.OffsetDateTime;
+import java.util.Collections;
+import java.util.Map;
+
+public final class StorageTaskImpl implements StorageTask, StorageTask.Definition, StorageTask.Update {
+ private StorageTaskInner innerObject;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager 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 ManagedServiceIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Long taskVersion() {
+ return this.innerModel().taskVersion();
+ }
+
+ public boolean enabled() {
+ return this.innerModel().enabled();
+ }
+
+ public String description() {
+ return this.innerModel().description();
+ }
+
+ public StorageTaskAction action() {
+ return this.innerModel().action();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public OffsetDateTime creationTimeInUtc() {
+ return this.innerModel().creationTimeInUtc();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public StorageTaskInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String storageTaskName;
+
+ private StorageTaskUpdateParameters updateParameters;
+
+ public StorageTaskImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public StorageTask create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getStorageTasks()
+ .create(resourceGroupName, storageTaskName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public StorageTask create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getStorageTasks()
+ .create(resourceGroupName, storageTaskName, this.innerModel(), context);
+ return this;
+ }
+
+ StorageTaskImpl(String name, com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerObject = new StorageTaskInner();
+ this.serviceManager = serviceManager;
+ this.storageTaskName = name;
+ }
+
+ public StorageTaskImpl update() {
+ this.updateParameters = new StorageTaskUpdateParameters();
+ return this;
+ }
+
+ public StorageTask apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getStorageTasks()
+ .update(resourceGroupName, storageTaskName, updateParameters, Context.NONE);
+ return this;
+ }
+
+ public StorageTask apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getStorageTasks()
+ .update(resourceGroupName, storageTaskName, updateParameters, context);
+ return this;
+ }
+
+ StorageTaskImpl(
+ StorageTaskInner innerObject, com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.storageTaskName = Utils.getValueFromIdByName(innerObject.id(), "storageTasks");
+ }
+
+ public StorageTask refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getStorageTasks()
+ .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public StorageTask refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getStorageTasks()
+ .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, context)
+ .getValue();
+ return this;
+ }
+
+ public StorageTaskImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public StorageTaskImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public StorageTaskImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateParameters.withTags(tags);
+ return this;
+ }
+ }
+
+ public StorageTaskImpl withIdentity(ManagedServiceIdentity identity) {
+ if (isInCreateMode()) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ } else {
+ this.updateParameters.withIdentity(identity);
+ return this;
+ }
+ }
+
+ public StorageTaskImpl withEnabled(boolean enabled) {
+ if (isInCreateMode()) {
+ this.innerModel().withEnabled(enabled);
+ return this;
+ } else {
+ this.updateParameters.withEnabled(enabled);
+ return this;
+ }
+ }
+
+ public StorageTaskImpl withDescription(String description) {
+ if (isInCreateMode()) {
+ this.innerModel().withDescription(description);
+ return this;
+ } else {
+ this.updateParameters.withDescription(description);
+ return this;
+ }
+ }
+
+ public StorageTaskImpl withAction(StorageTaskAction action) {
+ if (isInCreateMode()) {
+ this.innerModel().withAction(action);
+ return this;
+ } else {
+ this.updateParameters.withAction(action);
+ return this;
+ }
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskPreviewActionImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskPreviewActionImpl.java
new file mode 100644
index 000000000000..d4b4d6f39712
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskPreviewActionImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskPreviewActionInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewAction;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewActionCondition;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewBlobProperties;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewContainerProperties;
+import java.util.Collections;
+import java.util.List;
+
+public final class StorageTaskPreviewActionImpl implements StorageTaskPreviewAction {
+ private StorageTaskPreviewActionInner innerObject;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ StorageTaskPreviewActionImpl(
+ StorageTaskPreviewActionInner innerObject,
+ com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public StorageTaskPreviewContainerProperties container() {
+ return this.innerModel().container();
+ }
+
+ public List blobs() {
+ List inner = this.innerModel().blobs();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public StorageTaskPreviewActionCondition action() {
+ return this.innerModel().action();
+ }
+
+ public StorageTaskPreviewActionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskReportInstanceImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskReportInstanceImpl.java
new file mode 100644
index 000000000000..8c039d39a50c
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTaskReportInstanceImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskReportInstanceInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskReportInstance;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskReportProperties;
+
+public final class StorageTaskReportInstanceImpl implements StorageTaskReportInstance {
+ private StorageTaskReportInstanceInner innerObject;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ StorageTaskReportInstanceImpl(
+ StorageTaskReportInstanceInner innerObject,
+ com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public StorageTaskReportProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public StorageTaskReportInstanceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksClientImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksClientImpl.java
new file mode 100644
index 000000000000..716e6b5c38ea
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksClientImpl.java
@@ -0,0 +1,1752 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTasksClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskInner;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskPreviewActionInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskUpdateParameters;
+import com.azure.resourcemanager.storagetasks.models.StorageTasksListResult;
+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 StorageTasksClient. */
+public final class StorageTasksClientImpl implements StorageTasksClient {
+ /** The proxy service used to perform REST calls. */
+ private final StorageTasksService service;
+
+ /** The service client containing this operation class. */
+ private final StorageTasksManagementClientImpl client;
+
+ /**
+ * Initializes an instance of StorageTasksClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ StorageTasksClientImpl(StorageTasksManagementClientImpl client) {
+ this.service =
+ RestProxy.create(StorageTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StorageTasksManagementClientStorageTasks to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StorageTasksManageme")
+ public interface StorageTasksService {
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks/{storageTaskName}")
+ @ExpectedResponses({200, 201, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("storageTaskName") String storageTaskName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") StorageTaskInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks/{storageTaskName}")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("storageTaskName") String storageTaskName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks/{storageTaskName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("storageTaskName") String storageTaskName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks/{storageTaskName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("storageTaskName") String storageTaskName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") StorageTaskUpdateParameters parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StorageTasks/storageTasks")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.StorageTasks/previewActions")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> previewActions(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") StorageTaskPreviewActionInner parameters,
+ @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);
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents Storage Task along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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 (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .create(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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 (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .create(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, StorageTaskInner> beginCreateAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters) {
+ Mono>> mono = createWithResponseAsync(resourceGroupName, storageTaskName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ StorageTaskInner.class,
+ StorageTaskInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, StorageTaskInner> beginCreateAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createWithResponseAsync(resourceGroupName, storageTaskName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), StorageTaskInner.class, StorageTaskInner.class, context);
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, StorageTaskInner> beginCreate(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters) {
+ return this.beginCreateAsync(resourceGroupName, storageTaskName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, StorageTaskInner> beginCreate(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context) {
+ return this.beginCreateAsync(resourceGroupName, storageTaskName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents Storage Task on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters) {
+ return beginCreateAsync(resourceGroupName, storageTaskName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @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 represents Storage Task on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context) {
+ return beginCreateAsync(resourceGroupName, storageTaskName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters) {
+ return createAsync(resourceGroupName, storageTaskName, parameters).block();
+ }
+
+ /**
+ * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already
+ * created and a subsequent create request is issued with different properties, the storage task properties will be
+ * updated. If a storage task is already created and a subsequent create or update request is issued with the exact
+ * same set of properties, the request will succeed.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to create a Storage Task.
+ * @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 represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public StorageTaskInner create(
+ String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context) {
+ return createAsync(resourceGroupName, storageTaskName, parameters, context).block();
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String storageTaskName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String storageTaskName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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
+ .delete(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context);
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageTaskName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String storageTaskName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName) {
+ return this.beginDeleteAsync(resourceGroupName, storageTaskName).getSyncPoller();
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String storageTaskName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, storageTaskName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String storageTaskName) {
+ return beginDeleteAsync(resourceGroupName, storageTaskName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String storageTaskName, Context context) {
+ return beginDeleteAsync(resourceGroupName, storageTaskName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 storageTaskName) {
+ deleteAsync(resourceGroupName, storageTaskName).block();
+ }
+
+ /**
+ * Delete the storage task resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storageTaskName, Context context) {
+ deleteAsync(resourceGroupName, storageTaskName, context).block();
+ }
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 storage task properties along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String storageTaskName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storage task properties along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String storageTaskName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context);
+ }
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 storage task properties on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String storageTaskName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @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 storage task properties along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String storageTaskName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName, context).block();
+ }
+
+ /**
+ * Get the storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 storage task properties.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName) {
+ return getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE).getValue();
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents Storage Task along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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 (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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 (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ storageTaskName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, StorageTaskInner> beginUpdateAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, storageTaskName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ StorageTaskInner.class,
+ StorageTaskInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, StorageTaskInner> beginUpdateAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, storageTaskName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), StorageTaskInner.class, StorageTaskInner.class, context);
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, StorageTaskInner> beginUpdate(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters) {
+ return this.beginUpdateAsync(resourceGroupName, storageTaskName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, StorageTaskInner> beginUpdate(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, storageTaskName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents Storage Task on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters) {
+ return beginUpdateAsync(resourceGroupName, storageTaskName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @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 represents Storage Task on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context) {
+ return beginUpdateAsync(resourceGroupName, storageTaskName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public StorageTaskInner update(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters) {
+ return updateAsync(resourceGroupName, storageTaskName, parameters).block();
+ }
+
+ /**
+ * Update storage task properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param parameters The parameters to provide to update the storage task resource.
+ * @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 represents Storage Task.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public StorageTaskInner update(
+ String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, Context context) {
+ return updateAsync(resourceGroupName, storageTaskName, parameters, context).block();
+ }
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Lists all the storage tasks available under the 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName 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
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName 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
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Lists all the storage tasks available under the given 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 the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> previewActionsWithResponseAsync(
+ StorageTaskPreviewActionInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .previewActions(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @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 storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> previewActionsWithResponseAsync(
+ StorageTaskPreviewActionInner parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .previewActions(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return storage Task Preview Action on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono previewActionsAsync(StorageTaskPreviewActionInner parameters) {
+ return previewActionsWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @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 storage Task Preview Action along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response previewActionsWithResponse(
+ StorageTaskPreviewActionInner parameters, Context context) {
+ return previewActionsWithResponseAsync(parameters, context).block();
+ }
+
+ /**
+ * Runs the input conditions against input object metadata properties and designates matched objects in response.
+ *
+ * @param parameters The parameters to preview action condition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return storage Task Preview Action.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public StorageTaskPreviewActionInner previewActions(StorageTaskPreviewActionInner parameters) {
+ return previewActionsWithResponse(parameters, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksImpl.java
new file mode 100644
index 000000000000..73649164a73c
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksImpl.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.StorageTasksClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskInner;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskPreviewActionInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTask;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskPreviewAction;
+import com.azure.resourcemanager.storagetasks.models.StorageTasks;
+
+public final class StorageTasksImpl implements StorageTasks {
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTasksImpl.class);
+
+ private final StorageTasksClient innerClient;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ public StorageTasksImpl(
+ StorageTasksClient innerClient, com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String storageTaskName) {
+ this.serviceClient().delete(resourceGroupName, storageTaskName);
+ }
+
+ public void delete(String resourceGroupName, String storageTaskName, Context context) {
+ this.serviceClient().delete(resourceGroupName, storageTaskName, context);
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String storageTaskName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, storageTaskName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new StorageTaskImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public StorageTask getByResourceGroup(String resourceGroupName, String storageTaskName) {
+ StorageTaskInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, storageTaskName);
+ if (inner != null) {
+ return new StorageTaskImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager()));
+ }
+
+ public Response previewActionsWithResponse(
+ StorageTaskPreviewActionInner parameters, Context context) {
+ Response inner =
+ this.serviceClient().previewActionsWithResponse(parameters, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new StorageTaskPreviewActionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public StorageTaskPreviewAction previewActions(StorageTaskPreviewActionInner parameters) {
+ StorageTaskPreviewActionInner inner = this.serviceClient().previewActions(parameters);
+ if (inner != null) {
+ return new StorageTaskPreviewActionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public StorageTask 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 storageTaskName = Utils.getValueFromIdByName(id, "storageTasks");
+ if (storageTaskName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, storageTaskName, 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 storageTaskName = Utils.getValueFromIdByName(id, "storageTasks");
+ if (storageTaskName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, storageTaskName, 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 storageTaskName = Utils.getValueFromIdByName(id, "storageTasks");
+ if (storageTaskName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id)));
+ }
+ this.delete(resourceGroupName, storageTaskName, 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 storageTaskName = Utils.getValueFromIdByName(id, "storageTasks");
+ if (storageTaskName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'storageTasks'.", id)));
+ }
+ this.delete(resourceGroupName, storageTaskName, context);
+ }
+
+ private StorageTasksClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+
+ public StorageTaskImpl define(String name) {
+ return new StorageTaskImpl(name, this.manager());
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksManagementClientBuilder.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksManagementClientBuilder.java
new file mode 100644
index 000000000000..7e7ddf086903
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksManagementClientBuilder.java
@@ -0,0 +1,144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the StorageTasksManagementClientImpl type. */
+@ServiceClientBuilder(serviceClients = {StorageTasksManagementClientImpl.class})
+public final class StorageTasksManagementClientBuilder {
+ /*
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the StorageTasksManagementClientBuilder.
+ */
+ public StorageTasksManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the StorageTasksManagementClientBuilder.
+ */
+ public StorageTasksManagementClientBuilder 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 StorageTasksManagementClientBuilder.
+ */
+ public StorageTasksManagementClientBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the StorageTasksManagementClientBuilder.
+ */
+ public StorageTasksManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the StorageTasksManagementClientBuilder.
+ */
+ public StorageTasksManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the StorageTasksManagementClientBuilder.
+ */
+ public StorageTasksManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of StorageTasksManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of StorageTasksManagementClientImpl.
+ */
+ public StorageTasksManagementClientImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
+ AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
+ HttpPipeline localPipeline =
+ (pipeline != null)
+ ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval =
+ (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter =
+ (serializerAdapter != null)
+ ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ StorageTasksManagementClientImpl client =
+ new StorageTasksManagementClientImpl(
+ localPipeline,
+ localSerializerAdapter,
+ localDefaultPollInterval,
+ localEnvironment,
+ subscriptionId,
+ localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksManagementClientImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksManagementClientImpl.java
new file mode 100644
index 000000000000..acecedb23c50
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksManagementClientImpl.java
@@ -0,0 +1,332 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.storagetasks.fluent.OperationsClient;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTaskAssignmentsClient;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTasksClient;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTasksManagementClient;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTasksReportsClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the StorageTasksManagementClientImpl type. */
+@ServiceClient(builder = StorageTasksManagementClientBuilder.class)
+public final class StorageTasksManagementClientImpl implements StorageTasksManagementClient {
+ /** The ID of the target subscription. The value must be an UUID. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @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 StorageTasksClient object to access its operations. */
+ private final StorageTasksClient storageTasks;
+
+ /**
+ * Gets the StorageTasksClient object to access its operations.
+ *
+ * @return the StorageTasksClient object.
+ */
+ public StorageTasksClient getStorageTasks() {
+ return this.storageTasks;
+ }
+
+ /** The StorageTaskAssignmentsClient object to access its operations. */
+ private final StorageTaskAssignmentsClient storageTaskAssignments;
+
+ /**
+ * Gets the StorageTaskAssignmentsClient object to access its operations.
+ *
+ * @return the StorageTaskAssignmentsClient object.
+ */
+ public StorageTaskAssignmentsClient getStorageTaskAssignments() {
+ return this.storageTaskAssignments;
+ }
+
+ /** The StorageTasksReportsClient object to access its operations. */
+ private final StorageTasksReportsClient storageTasksReports;
+
+ /**
+ * Gets the StorageTasksReportsClient object to access its operations.
+ *
+ * @return the StorageTasksReportsClient object.
+ */
+ public StorageTasksReportsClient getStorageTasksReports() {
+ return this.storageTasksReports;
+ }
+
+ /**
+ * Initializes an instance of StorageTasksManagementClient 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. The value must be an UUID.
+ * @param endpoint server parameter.
+ */
+ StorageTasksManagementClientImpl(
+ 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 = "2023-01-01";
+ this.operations = new OperationsClientImpl(this);
+ this.storageTasks = new StorageTasksClientImpl(this);
+ this.storageTaskAssignments = new StorageTaskAssignmentsClientImpl(this);
+ this.storageTasksReports = new StorageTasksReportsClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(
+ Mono>> activationResponse,
+ HttpPipeline httpPipeline,
+ Type pollResultType,
+ Type finalResultType,
+ Context context) {
+ return PollerFactory
+ .create(
+ serializerAdapter,
+ httpPipeline,
+ pollResultType,
+ finalResultType,
+ defaultPollInterval,
+ activationResponse,
+ context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse =
+ new HttpResponseImpl(
+ lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError =
+ this
+ .getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(s);
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTasksManagementClientImpl.class);
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksReportsClientImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksReportsClientImpl.java
new file mode 100644
index 000000000000..f519d4daf4b7
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksReportsClientImpl.java
@@ -0,0 +1,393 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.storagetasks.fluent.StorageTasksReportsClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskReportInstanceInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskReportSummary;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in StorageTasksReportsClient. */
+public final class StorageTasksReportsClientImpl implements StorageTasksReportsClient {
+ /** The proxy service used to perform REST calls. */
+ private final StorageTasksReportsService service;
+
+ /** The service client containing this operation class. */
+ private final StorageTasksManagementClientImpl client;
+
+ /**
+ * Initializes an instance of StorageTasksReportsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ StorageTasksReportsClientImpl(StorageTasksManagementClientImpl client) {
+ this.service =
+ RestProxy.create(StorageTasksReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for StorageTasksManagementClientStorageTasksReports to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "StorageTasksManageme")
+ public interface StorageTasksReportsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageTasks/storageTasks/{storageTaskName}/reports")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("storageTaskName") String storageTaskName,
+ @QueryParam("$maxpagesize") String maxpagesize,
+ @QueryParam("$filter") String filter,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @param filter Optional. When specified, it can be used to query using reporting properties.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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(),
+ resourceGroupName,
+ storageTaskName,
+ maxpagesize,
+ filter,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @param filter Optional. When specified, it can be used to query using reporting properties.
+ * @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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (storageTaskName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter storageTaskName 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(),
+ resourceGroupName,
+ storageTaskName,
+ maxpagesize,
+ filter,
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @param filter Optional. When specified, it can be used to query using reporting properties.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String storageTaskName) {
+ final String maxpagesize = null;
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @param filter Optional. When specified, it can be used to query using reporting properties.
+ * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String storageTaskName) {
+ final String maxpagesize = null;
+ final String filter = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, filter));
+ }
+
+ /**
+ * Fetch the storage tasks run report summary for each assignment.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
+ * be between 3 and 18 characters in length and use numbers and lower-case letters only.
+ * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
+ * list response.
+ * @param filter Optional. When specified, it can be used to query using reporting properties.
+ * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, filter, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(
+ 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
+ .listNext(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/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksReportsImpl.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksReportsImpl.java
new file mode 100644
index 000000000000..73b4b0ceb29d
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/StorageTasksReportsImpl.java
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.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.storagetasks.fluent.StorageTasksReportsClient;
+import com.azure.resourcemanager.storagetasks.fluent.models.StorageTaskReportInstanceInner;
+import com.azure.resourcemanager.storagetasks.models.StorageTaskReportInstance;
+import com.azure.resourcemanager.storagetasks.models.StorageTasksReports;
+
+public final class StorageTasksReportsImpl implements StorageTasksReports {
+ private static final ClientLogger LOGGER = new ClientLogger(StorageTasksReportsImpl.class);
+
+ private final StorageTasksReportsClient innerClient;
+
+ private final com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager;
+
+ public StorageTasksReportsImpl(
+ StorageTasksReportsClient innerClient,
+ com.azure.resourcemanager.storagetasks.StorageTasksManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String storageTaskName) {
+ PagedIterable inner =
+ this.serviceClient().list(resourceGroupName, storageTaskName);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(
+ String resourceGroupName, String storageTaskName, String maxpagesize, String filter, Context context) {
+ PagedIterable inner =
+ this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, filter, context);
+ return Utils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager()));
+ }
+
+ private StorageTasksReportsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.storagetasks.StorageTasksManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/Utils.java b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/Utils.java
new file mode 100644
index 000000000000..3f8ae8b4aea9
--- /dev/null
+++ b/sdk/storagetasks/azure-resourcemanager-storagetasks/src/main/java/com/azure/resourcemanager/storagetasks/implementation/Utils.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.storagetasks.implementation;
+
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class Utils {
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (segments.size() > 0 && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(
+ PagedFlux
+ .create(
+ () ->
+ (continuationToken, pageSize) ->
+ Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page ->
+ new PagedResponseBase(
+ page.getRequest(),
+ page.getStatusCode(),
+ page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()),
+ page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable