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 Durable Task service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Durable Task service API instance.
+ */
+ public DurableTaskManager 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.durabletask")
+ .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 DurableTaskManager(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 Schedulers. It manages Scheduler.
+ *
+ * @return Resource collection API of Schedulers.
+ */
+ public Schedulers schedulers() {
+ if (this.schedulers == null) {
+ this.schedulers = new SchedulersImpl(clientObject.getSchedulers(), this);
+ }
+ return schedulers;
+ }
+
+ /**
+ * Gets the resource collection API of TaskHubs. It manages TaskHub.
+ *
+ * @return Resource collection API of TaskHubs.
+ */
+ public TaskHubs taskHubs() {
+ if (this.taskHubs == null) {
+ this.taskHubs = new TaskHubsImpl(clientObject.getTaskHubs(), this);
+ }
+ return taskHubs;
+ }
+
+ /**
+ * Gets wrapped service client DurableTaskClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client DurableTaskClient.
+ */
+ public DurableTaskClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskClient.java
new file mode 100644
index 0000000000000..3731d0f81178e
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/DurableTaskClient.java
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for DurableTaskClient class.
+ */
+public interface DurableTaskClient {
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * 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 SchedulersClient object to access its operations.
+ *
+ * @return the SchedulersClient object.
+ */
+ SchedulersClient getSchedulers();
+
+ /**
+ * Gets the TaskHubsClient object to access its operations.
+ *
+ * @return the TaskHubsClient object.
+ */
+ TaskHubsClient getTaskHubs();
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/OperationsClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..4b2c99323dc43
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/OperationsClient.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.models.OperationInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @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();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java
new file mode 100644
index 0000000000000..b03765e493fdc
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/SchedulersClient.java
@@ -0,0 +1,267 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.models.SchedulerInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in SchedulersClient.
+ */
+public interface SchedulersClient {
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 Scheduler along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String schedulerName,
+ Context context);
+
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 Scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SchedulerInner getByResourceGroup(String resourceGroupName, String schedulerName);
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SchedulerInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, SchedulerInner resource);
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SchedulerInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, SchedulerInner resource, Context context);
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SchedulerInner createOrUpdate(String resourceGroupName, String schedulerName, SchedulerInner resource);
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SchedulerInner createOrUpdate(String resourceGroupName, String schedulerName, SchedulerInner resource,
+ Context context);
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SchedulerInner> beginUpdate(String resourceGroupName, String schedulerName,
+ SchedulerInner properties);
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, SchedulerInner> beginUpdate(String resourceGroupName, String schedulerName,
+ SchedulerInner properties, Context context);
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SchedulerInner update(String resourceGroupName, String schedulerName, SchedulerInner properties);
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SchedulerInner update(String resourceGroupName, String schedulerName, SchedulerInner properties, Context context);
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName);
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName, Context context);
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName);
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName, Context context);
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskHubsClient.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskHubsClient.java
new file mode 100644
index 0000000000000..5ef65e5645d06
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/TaskHubsClient.java
@@ -0,0 +1,199 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.models.TaskHubInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in TaskHubsClient.
+ */
+public interface TaskHubsClient {
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 Task Hub along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName,
+ Context context);
+
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 Task Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TaskHubInner get(String resourceGroupName, String schedulerName, String taskHubName);
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 a Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, TaskHubInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource);
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 a Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, TaskHubInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource, Context context);
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TaskHubInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName,
+ TaskHubInner resource);
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ TaskHubInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName,
+ TaskHubInner resource, Context context);
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName, String taskHubName);
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName, String taskHubName,
+ Context context);
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName, String taskHubName);
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName, String taskHubName, Context context);
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 of a TaskHub list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByScheduler(String resourceGroupName, String schedulerName);
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 of a TaskHub list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByScheduler(String resourceGroupName, String schedulerName, Context context);
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/OperationInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..10e0e9ac2fc2b
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/OperationInner.java
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.durabletask.models.ActionType;
+import com.azure.resourcemanager.durabletask.models.OperationDisplay;
+import com.azure.resourcemanager.durabletask.models.Origin;
+import java.io.IOException;
+
+/**
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Immutable
+public final class OperationInner implements JsonSerializable {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
+ * Resource Manager/control-plane operations.
+ */
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ 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"
+ */
+ private Origin origin;
+
+ /*
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ private 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 Azure Resource Manager/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;
+ }
+
+ /**
+ * 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: Extensible 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();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("isDataAction".equals(fieldName)) {
+ deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedOperationInner.origin = Origin.fromString(reader.getString());
+ } else if ("actionType".equals(fieldName)) {
+ deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java
new file mode 100644
index 0000000000000..4296cd50a3bc6
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/SchedulerInner.java
@@ -0,0 +1,192 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.durabletask.models.SchedulerProperties;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * A Durable Task Scheduler resource.
+ */
+@Fluent
+public final class SchedulerInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private SchedulerProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of SchedulerInner class.
+ */
+ public SchedulerInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public SchedulerProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the SchedulerInner object itself.
+ */
+ public SchedulerInner withProperties(SchedulerProperties 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;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public SchedulerInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public SchedulerInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of SchedulerInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of SchedulerInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the SchedulerInner.
+ */
+ public static SchedulerInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ SchedulerInner deserializedSchedulerInner = new SchedulerInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedSchedulerInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedSchedulerInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedSchedulerInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedSchedulerInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedSchedulerInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedSchedulerInner.properties = SchedulerProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedSchedulerInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedSchedulerInner;
+ });
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskHubInner.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskHubInner.java
new file mode 100644
index 0000000000000..04f40d07c52ba
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/TaskHubInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.durabletask.models.TaskHubProperties;
+import java.io.IOException;
+
+/**
+ * A Task Hub resource belonging to the scheduler.
+ */
+@Fluent
+public final class TaskHubInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private TaskHubProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of TaskHubInner class.
+ */
+ public TaskHubInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public TaskHubProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the TaskHubInner object itself.
+ */
+ public TaskHubInner withProperties(TaskHubProperties 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;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TaskHubInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TaskHubInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the TaskHubInner.
+ */
+ public static TaskHubInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TaskHubInner deserializedTaskHubInner = new TaskHubInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedTaskHubInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedTaskHubInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedTaskHubInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedTaskHubInner.properties = TaskHubProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedTaskHubInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTaskHubInner;
+ });
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/package-info.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/models/package-info.java
new file mode 100644
index 0000000000000..0b5b6c1877195
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the inner data models for DurableTask.
+ */
+package com.azure.resourcemanager.durabletask.fluent.models;
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/package-info.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/package-info.java
new file mode 100644
index 0000000000000..becd3bb99cabc
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/fluent/package-info.java
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the service clients for DurableTask.
+ */
+package com.azure.resourcemanager.durabletask.fluent;
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskClientBuilder.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskClientBuilder.java
new file mode 100644
index 0000000000000..93fad53b04a9a
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskClientBuilder.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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 DurableTaskClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { DurableTaskClientImpl.class })
+public final class DurableTaskClientBuilder {
+ /*
+ * Service host
+ */
+ private String endpoint;
+
+ /**
+ * Sets Service host.
+ *
+ * @param endpoint the endpoint value.
+ * @return the DurableTaskClientBuilder.
+ */
+ public DurableTaskClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * 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 DurableTaskClientBuilder.
+ */
+ public DurableTaskClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the DurableTaskClientBuilder.
+ */
+ public DurableTaskClientBuilder 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 DurableTaskClientBuilder.
+ */
+ public DurableTaskClientBuilder 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 DurableTaskClientBuilder.
+ */
+ public DurableTaskClientBuilder 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 DurableTaskClientBuilder.
+ */
+ public DurableTaskClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of DurableTaskClientImpl with the provided parameters.
+ *
+ * @return an instance of DurableTaskClientImpl.
+ */
+ public DurableTaskClientImpl 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();
+ DurableTaskClientImpl client = new DurableTaskClientImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
+ return client;
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskClientImpl.java
new file mode 100644
index 0000000000000..e940b9a4de74c
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/DurableTaskClientImpl.java
@@ -0,0 +1,320 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+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.durabletask.fluent.DurableTaskClient;
+import com.azure.resourcemanager.durabletask.fluent.OperationsClient;
+import com.azure.resourcemanager.durabletask.fluent.SchedulersClient;
+import com.azure.resourcemanager.durabletask.fluent.TaskHubsClient;
+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 DurableTaskClientImpl type.
+ */
+@ServiceClient(builder = DurableTaskClientBuilder.class)
+public final class DurableTaskClientImpl implements DurableTaskClient {
+ /**
+ * Service host.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Version parameter.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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 SchedulersClient object to access its operations.
+ */
+ private final SchedulersClient schedulers;
+
+ /**
+ * Gets the SchedulersClient object to access its operations.
+ *
+ * @return the SchedulersClient object.
+ */
+ public SchedulersClient getSchedulers() {
+ return this.schedulers;
+ }
+
+ /**
+ * The TaskHubsClient object to access its operations.
+ */
+ private final TaskHubsClient taskHubs;
+
+ /**
+ * Gets the TaskHubsClient object to access its operations.
+ *
+ * @return the TaskHubsClient object.
+ */
+ public TaskHubsClient getTaskHubs() {
+ return this.taskHubs;
+ }
+
+ /**
+ * Initializes an instance of DurableTaskClient 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 endpoint Service host.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ */
+ DurableTaskClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval,
+ AzureEnvironment environment, String endpoint, String subscriptionId) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.subscriptionId = subscriptionId;
+ this.apiVersion = "2024-10-01-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.schedulers = new SchedulersClientImpl(this);
+ this.taskHubs = new TaskHubsClientImpl(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(HttpHeaderName.fromString(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(DurableTaskClientImpl.class);
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationImpl.java
new file mode 100644
index 0000000000000..f8a7088a170ce
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation;
+
+import com.azure.resourcemanager.durabletask.fluent.models.OperationInner;
+import com.azure.resourcemanager.durabletask.models.ActionType;
+import com.azure.resourcemanager.durabletask.models.Operation;
+import com.azure.resourcemanager.durabletask.models.OperationDisplay;
+import com.azure.resourcemanager.durabletask.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager;
+
+ OperationImpl(OperationInner innerObject, com.azure.resourcemanager.durabletask.DurableTaskManager 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.durabletask.DurableTaskManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..763a2fd5a7464
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsClientImpl.java
@@ -0,0 +1,235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.OperationsClient;
+import com.azure.resourcemanager.durabletask.fluent.models.OperationInner;
+import com.azure.resourcemanager.durabletask.implementation.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 DurableTaskClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(DurableTaskClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DurableTaskClientOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DurableTaskClientOpe")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.DurableTask/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws 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()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws 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));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws 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());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ * @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/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..b045326bd5820
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.OperationsClient;
+import com.azure.resourcemanager.durabletask.fluent.models.OperationInner;
+import com.azure.resourcemanager.durabletask.models.Operation;
+import com.azure.resourcemanager.durabletask.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.durabletask.DurableTaskManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.durabletask.DurableTaskManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/ResourceManagerUtils.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/ResourceManagerUtils.java
new file mode 100644
index 0000000000000..6605cb53e00ff
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/ResourceManagerUtils.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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 ResourceManagerUtils {
+ private ResourceManagerUtils() {
+ }
+
+ 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java
new file mode 100644
index 0000000000000..f1466d6d27f50
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulerImpl.java
@@ -0,0 +1,163 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner;
+import com.azure.resourcemanager.durabletask.models.Scheduler;
+import com.azure.resourcemanager.durabletask.models.SchedulerProperties;
+import java.util.Collections;
+import java.util.Map;
+
+public final class SchedulerImpl implements Scheduler, Scheduler.Definition, Scheduler.Update {
+ private SchedulerInner innerObject;
+
+ private final com.azure.resourcemanager.durabletask.DurableTaskManager 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 SchedulerProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public SchedulerInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.durabletask.DurableTaskManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String schedulerName;
+
+ public SchedulerImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public Scheduler create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getSchedulers()
+ .createOrUpdate(resourceGroupName, schedulerName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public Scheduler create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getSchedulers()
+ .createOrUpdate(resourceGroupName, schedulerName, this.innerModel(), context);
+ return this;
+ }
+
+ SchedulerImpl(String name, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerObject = new SchedulerInner();
+ this.serviceManager = serviceManager;
+ this.schedulerName = name;
+ }
+
+ public SchedulerImpl update() {
+ return this;
+ }
+
+ public Scheduler apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getSchedulers()
+ .update(resourceGroupName, schedulerName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public Scheduler apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getSchedulers()
+ .update(resourceGroupName, schedulerName, this.innerModel(), context);
+ return this;
+ }
+
+ SchedulerImpl(SchedulerInner innerObject, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.schedulerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "schedulers");
+ }
+
+ public Scheduler refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getSchedulers()
+ .getByResourceGroupWithResponse(resourceGroupName, schedulerName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Scheduler refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getSchedulers()
+ .getByResourceGroupWithResponse(resourceGroupName, schedulerName, context)
+ .getValue();
+ return this;
+ }
+
+ public SchedulerImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public SchedulerImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public SchedulerImpl withTags(Map tags) {
+ this.innerModel().withTags(tags);
+ return this;
+ }
+
+ public SchedulerImpl withProperties(SchedulerProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java
new file mode 100644
index 0000000000000..653dd1a64d017
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersClientImpl.java
@@ -0,0 +1,1275 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.durabletask.fluent.SchedulersClient;
+import com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner;
+import com.azure.resourcemanager.durabletask.implementation.models.SchedulerListResult;
+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 SchedulersClient.
+ */
+public final class SchedulersClientImpl implements SchedulersClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final SchedulersService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DurableTaskClientImpl client;
+
+ /**
+ * Initializes an instance of SchedulersClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SchedulersClientImpl(DurableTaskClientImpl client) {
+ this.service
+ = RestProxy.create(SchedulersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DurableTaskClientSchedulers to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DurableTaskClientSch")
+ public interface SchedulersService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") SchedulerInner resource, Context context);
+
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") SchedulerInner properties, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DurableTask/schedulers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @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> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @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("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Scheduler along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String schedulerName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 Scheduler along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String schedulerName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context);
+ }
+
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Scheduler on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String schedulerName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, schedulerName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 Scheduler along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String schedulerName,
+ Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, schedulerName, context).block();
+ }
+
+ /**
+ * Get a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SchedulerInner getByResourceGroup(String resourceGroupName, String schedulerName) {
+ return getByResourceGroupWithResponse(resourceGroupName, schedulerName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Durable Task Scheduler resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String schedulerName, SchedulerInner resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 Durable Task Scheduler resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String schedulerName, SchedulerInner resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, resource, context);
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SchedulerInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String schedulerName, SchedulerInner resource) {
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, schedulerName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ SchedulerInner.class, SchedulerInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SchedulerInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String schedulerName, SchedulerInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, schedulerName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ SchedulerInner.class, SchedulerInner.class, context);
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SchedulerInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, SchedulerInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, schedulerName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SchedulerInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, SchedulerInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, schedulerName, resource, context).getSyncPoller();
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Durable Task Scheduler resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String schedulerName,
+ SchedulerInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, schedulerName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 Durable Task Scheduler resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String schedulerName,
+ SchedulerInner resource, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, schedulerName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SchedulerInner createOrUpdate(String resourceGroupName, String schedulerName, SchedulerInner resource) {
+ return createOrUpdateAsync(resourceGroupName, schedulerName, resource).block();
+ }
+
+ /**
+ * Create or update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param resource Resource create parameters.
+ * @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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SchedulerInner createOrUpdate(String resourceGroupName, String schedulerName, SchedulerInner resource,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, schedulerName, resource, context).block();
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Durable Task Scheduler resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String schedulerName,
+ SchedulerInner properties) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, contentType, accept, properties,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 Durable Task Scheduler resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String schedulerName,
+ SchedulerInner properties, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, schedulerName, contentType, accept, properties, context);
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SchedulerInner> beginUpdateAsync(String resourceGroupName,
+ String schedulerName, SchedulerInner properties) {
+ Mono>> mono = updateWithResponseAsync(resourceGroupName, schedulerName, properties);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ SchedulerInner.class, SchedulerInner.class, this.client.getContext());
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, SchedulerInner> beginUpdateAsync(String resourceGroupName,
+ String schedulerName, SchedulerInner properties, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, schedulerName, properties, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ SchedulerInner.class, SchedulerInner.class, context);
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SchedulerInner> beginUpdate(String resourceGroupName,
+ String schedulerName, SchedulerInner properties) {
+ return this.beginUpdateAsync(resourceGroupName, schedulerName, properties).getSyncPoller();
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 a Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, SchedulerInner> beginUpdate(String resourceGroupName,
+ String schedulerName, SchedulerInner properties, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, schedulerName, properties, context).getSyncPoller();
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Durable Task Scheduler resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String schedulerName,
+ SchedulerInner properties) {
+ return beginUpdateAsync(resourceGroupName, schedulerName, properties).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 Durable Task Scheduler resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String schedulerName, SchedulerInner properties,
+ Context context) {
+ return beginUpdateAsync(resourceGroupName, schedulerName, properties, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SchedulerInner update(String resourceGroupName, String schedulerName, SchedulerInner properties) {
+ return updateAsync(resourceGroupName, schedulerName, properties).block();
+ }
+
+ /**
+ * Update a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param properties The resource properties to be updated.
+ * @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 Durable Task Scheduler resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SchedulerInner update(String resourceGroupName, String schedulerName, SchedulerInner properties,
+ Context context) {
+ return updateAsync(resourceGroupName, schedulerName, properties, context).block();
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, schedulerName, accept, context);
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, schedulerName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, schedulerName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName) {
+ return this.beginDeleteAsync(resourceGroupName, schedulerName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName,
+ Context context) {
+ return this.beginDeleteAsync(resourceGroupName, schedulerName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName) {
+ return beginDeleteAsync(resourceGroupName, schedulerName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName, Context context) {
+ return beginDeleteAsync(resourceGroupName, schedulerName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 schedulerName) {
+ deleteAsync(resourceGroupName, schedulerName).block();
+ }
+
+ /**
+ * Delete a Scheduler.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 schedulerName, Context context) {
+ deleteAsync(resourceGroupName, schedulerName, context).block();
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list 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 (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list 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 (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list 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));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list 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()));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list 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));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list 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));
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List Schedulers by 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 of a Scheduler list operation 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 of a Scheduler list 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.
+ * @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 of a Scheduler list 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));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 of a Scheduler list 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.
+ * @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 of a Scheduler list 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));
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java
new file mode 100644
index 0000000000000..e6558275cea9e
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/SchedulersImpl.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.SchedulersClient;
+import com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner;
+import com.azure.resourcemanager.durabletask.models.Scheduler;
+import com.azure.resourcemanager.durabletask.models.Schedulers;
+
+public final class SchedulersImpl implements Schedulers {
+ private static final ClientLogger LOGGER = new ClientLogger(SchedulersImpl.class);
+
+ private final SchedulersClient innerClient;
+
+ private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager;
+
+ public SchedulersImpl(SchedulersClient innerClient,
+ com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String schedulerName,
+ Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, schedulerName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new SchedulerImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Scheduler getByResourceGroup(String resourceGroupName, String schedulerName) {
+ SchedulerInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, schedulerName);
+ if (inner != null) {
+ return new SchedulerImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String schedulerName) {
+ this.serviceClient().delete(resourceGroupName, schedulerName);
+ }
+
+ public void delete(String resourceGroupName, String schedulerName, Context context) {
+ this.serviceClient().delete(resourceGroupName, schedulerName, context);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new SchedulerImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new SchedulerImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new SchedulerImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new SchedulerImpl(inner1, this.manager()));
+ }
+
+ public Scheduler getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, schedulerName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, schedulerName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ this.delete(resourceGroupName, schedulerName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ this.delete(resourceGroupName, schedulerName, context);
+ }
+
+ private SchedulersClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.durabletask.DurableTaskManager manager() {
+ return this.serviceManager;
+ }
+
+ public SchedulerImpl define(String name) {
+ return new SchedulerImpl(name, this.manager());
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubImpl.java
new file mode 100644
index 0000000000000..2ab5a9df013ce
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubImpl.java
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner;
+import com.azure.resourcemanager.durabletask.models.TaskHub;
+import com.azure.resourcemanager.durabletask.models.TaskHubProperties;
+
+public final class TaskHubImpl implements TaskHub, TaskHub.Definition, TaskHub.Update {
+ private TaskHubInner innerObject;
+
+ private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public TaskHubProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public TaskHubInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.durabletask.DurableTaskManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String schedulerName;
+
+ private String taskHubName;
+
+ public TaskHubImpl withExistingScheduler(String resourceGroupName, String schedulerName) {
+ this.resourceGroupName = resourceGroupName;
+ this.schedulerName = schedulerName;
+ return this;
+ }
+
+ public TaskHub create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getTaskHubs()
+ .createOrUpdate(resourceGroupName, schedulerName, taskHubName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public TaskHub create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getTaskHubs()
+ .createOrUpdate(resourceGroupName, schedulerName, taskHubName, this.innerModel(), context);
+ return this;
+ }
+
+ TaskHubImpl(String name, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerObject = new TaskHubInner();
+ this.serviceManager = serviceManager;
+ this.taskHubName = name;
+ }
+
+ public TaskHubImpl update() {
+ return this;
+ }
+
+ public TaskHub apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getTaskHubs()
+ .createOrUpdate(resourceGroupName, schedulerName, taskHubName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public TaskHub apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getTaskHubs()
+ .createOrUpdate(resourceGroupName, schedulerName, taskHubName, this.innerModel(), context);
+ return this;
+ }
+
+ TaskHubImpl(TaskHubInner innerObject, com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.schedulerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "schedulers");
+ this.taskHubName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "taskHubs");
+ }
+
+ public TaskHub refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getTaskHubs()
+ .getWithResponse(resourceGroupName, schedulerName, taskHubName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public TaskHub refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getTaskHubs()
+ .getWithResponse(resourceGroupName, schedulerName, taskHubName, context)
+ .getValue();
+ return this;
+ }
+
+ public TaskHubImpl withProperties(TaskHubProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsClientImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsClientImpl.java
new file mode 100644
index 0000000000000..2ea67bd556768
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsClientImpl.java
@@ -0,0 +1,918 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.durabletask.fluent.TaskHubsClient;
+import com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner;
+import com.azure.resourcemanager.durabletask.implementation.models.TaskHubListResult;
+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 TaskHubsClient.
+ */
+public final class TaskHubsClientImpl implements TaskHubsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final TaskHubsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DurableTaskClientImpl client;
+
+ /**
+ * Initializes an instance of TaskHubsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ TaskHubsClientImpl(DurableTaskClientImpl client) {
+ this.service = RestProxy.create(TaskHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DurableTaskClientTaskHubs to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DurableTaskClientTas")
+ public interface TaskHubsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @PathParam("taskHubName") String taskHubName, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @PathParam("taskHubName") String taskHubName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") TaskHubInner resource,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs/{taskHubName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @PathParam("taskHubName") String taskHubName, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/taskHubs")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByScheduler(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("schedulerName") String schedulerName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySchedulerNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Task Hub along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName, String schedulerName,
+ String taskHubName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (taskHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter taskHubName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 Task Hub along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName, String schedulerName,
+ String taskHubName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (taskHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter taskHubName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, schedulerName, taskHubName, accept, context);
+ }
+
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Task Hub on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String schedulerName, String taskHubName) {
+ return getWithResponseAsync(resourceGroupName, schedulerName, taskHubName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 Task Hub along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName,
+ Context context) {
+ return getWithResponseAsync(resourceGroupName, schedulerName, taskHubName, context).block();
+ }
+
+ /**
+ * Get a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Task Hub.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TaskHubInner get(String resourceGroupName, String schedulerName, String taskHubName) {
+ return getWithResponse(resourceGroupName, schedulerName, taskHubName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Task Hub resource belonging to the scheduler along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (taskHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter taskHubName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, contentType, accept,
+ resource, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 Task Hub resource belonging to the scheduler along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (taskHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter taskHubName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, contentType, accept,
+ resource, context);
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 a Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, TaskHubInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource) {
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, schedulerName, taskHubName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ TaskHubInner.class, TaskHubInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 a Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, TaskHubInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, schedulerName, taskHubName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ TaskHubInner.class, TaskHubInner.class, context);
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 a Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, TaskHubInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 a Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, TaskHubInner> beginCreateOrUpdate(String resourceGroupName,
+ String schedulerName, String taskHubName, TaskHubInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, resource, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Task Hub resource belonging to the scheduler on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String schedulerName, String taskHubName,
+ TaskHubInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 Task Hub resource belonging to the scheduler on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String schedulerName, String taskHubName,
+ TaskHubInner resource, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TaskHubInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName,
+ TaskHubInner resource) {
+ return createOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, resource).block();
+ }
+
+ /**
+ * Create or Update a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @param resource Resource create parameters.
+ * @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 Task Hub resource belonging to the scheduler.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public TaskHubInner createOrUpdate(String resourceGroupName, String schedulerName, String taskHubName,
+ TaskHubInner resource, Context context) {
+ return createOrUpdateAsync(resourceGroupName, schedulerName, taskHubName, resource, context).block();
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName,
+ String taskHubName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (taskHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter taskHubName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, taskHubName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName,
+ String taskHubName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ if (taskHubName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter taskHubName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, schedulerName, taskHubName, accept, context);
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName,
+ String taskHubName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, schedulerName, taskHubName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName,
+ String taskHubName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = deleteWithResponseAsync(resourceGroupName, schedulerName, taskHubName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName,
+ String taskHubName) {
+ return this.beginDeleteAsync(resourceGroupName, schedulerName, taskHubName).getSyncPoller();
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName,
+ String taskHubName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, schedulerName, taskHubName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 schedulerName, String taskHubName) {
+ return beginDeleteAsync(resourceGroupName, schedulerName, taskHubName).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName, String taskHubName,
+ Context context) {
+ return beginDeleteAsync(resourceGroupName, schedulerName, taskHubName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 schedulerName, String taskHubName) {
+ deleteAsync(resourceGroupName, schedulerName, taskHubName).block();
+ }
+
+ /**
+ * Delete a Task Hub.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @param taskHubName The name of the TaskHub.
+ * @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 schedulerName, String taskHubName, Context context) {
+ deleteAsync(resourceGroupName, schedulerName, taskHubName, context).block();
+ }
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 of a TaskHub list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySchedulerSinglePageAsync(String resourceGroupName,
+ String schedulerName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByScheduler(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, schedulerName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 of a TaskHub list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySchedulerSinglePageAsync(String resourceGroupName,
+ String schedulerName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (schedulerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter schedulerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByScheduler(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, schedulerName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 of a TaskHub list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listBySchedulerAsync(String resourceGroupName, String schedulerName) {
+ return new PagedFlux<>(() -> listBySchedulerSinglePageAsync(resourceGroupName, schedulerName),
+ nextLink -> listBySchedulerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 of a TaskHub list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listBySchedulerAsync(String resourceGroupName, String schedulerName,
+ Context context) {
+ return new PagedFlux<>(() -> listBySchedulerSinglePageAsync(resourceGroupName, schedulerName, context),
+ nextLink -> listBySchedulerNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 of a TaskHub list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) {
+ return new PagedIterable<>(listBySchedulerAsync(resourceGroupName, schedulerName));
+ }
+
+ /**
+ * List Task Hubs.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param schedulerName The name of the Scheduler.
+ * @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 of a TaskHub list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByScheduler(String resourceGroupName, String schedulerName,
+ Context context) {
+ return new PagedIterable<>(listBySchedulerAsync(resourceGroupName, schedulerName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 of a TaskHub list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySchedulerNextSinglePageAsync(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.listBySchedulerNext(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.
+ * @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 of a TaskHub list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySchedulerNextSinglePageAsync(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.listBySchedulerNext(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/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsImpl.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsImpl.java
new file mode 100644
index 0000000000000..8b3932123efb1
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/TaskHubsImpl.java
@@ -0,0 +1,157 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.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.durabletask.fluent.TaskHubsClient;
+import com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner;
+import com.azure.resourcemanager.durabletask.models.TaskHub;
+import com.azure.resourcemanager.durabletask.models.TaskHubs;
+
+public final class TaskHubsImpl implements TaskHubs {
+ private static final ClientLogger LOGGER = new ClientLogger(TaskHubsImpl.class);
+
+ private final TaskHubsClient innerClient;
+
+ private final com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager;
+
+ public TaskHubsImpl(TaskHubsClient innerClient,
+ com.azure.resourcemanager.durabletask.DurableTaskManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(String resourceGroupName, String schedulerName, String taskHubName,
+ Context context) {
+ Response inner
+ = this.serviceClient().getWithResponse(resourceGroupName, schedulerName, taskHubName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new TaskHubImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public TaskHub get(String resourceGroupName, String schedulerName, String taskHubName) {
+ TaskHubInner inner = this.serviceClient().get(resourceGroupName, schedulerName, taskHubName);
+ if (inner != null) {
+ return new TaskHubImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String resourceGroupName, String schedulerName, String taskHubName) {
+ this.serviceClient().delete(resourceGroupName, schedulerName, taskHubName);
+ }
+
+ public void delete(String resourceGroupName, String schedulerName, String taskHubName, Context context) {
+ this.serviceClient().delete(resourceGroupName, schedulerName, taskHubName, context);
+ }
+
+ public PagedIterable listByScheduler(String resourceGroupName, String schedulerName) {
+ PagedIterable inner = this.serviceClient().listByScheduler(resourceGroupName, schedulerName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new TaskHubImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByScheduler(String resourceGroupName, String schedulerName, Context context) {
+ PagedIterable inner
+ = this.serviceClient().listByScheduler(resourceGroupName, schedulerName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new TaskHubImpl(inner1, this.manager()));
+ }
+
+ public TaskHub getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs");
+ if (taskHubName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, schedulerName, taskHubName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs");
+ if (taskHubName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, schedulerName, taskHubName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs");
+ if (taskHubName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id)));
+ }
+ this.delete(resourceGroupName, schedulerName, taskHubName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 schedulerName = ResourceManagerUtils.getValueFromIdByName(id, "schedulers");
+ if (schedulerName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'schedulers'.", id)));
+ }
+ String taskHubName = ResourceManagerUtils.getValueFromIdByName(id, "taskHubs");
+ if (taskHubName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'taskHubs'.", id)));
+ }
+ this.delete(resourceGroupName, schedulerName, taskHubName, context);
+ }
+
+ private TaskHubsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.durabletask.DurableTaskManager manager() {
+ return this.serviceManager;
+ }
+
+ public TaskHubImpl define(String name) {
+ return new TaskHubImpl(name, this.manager());
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/OperationListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/OperationListResult.java
new file mode 100644
index 0000000000000..b6a9cfba66937
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/OperationListResult.java
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.durabletask.fluent.models.OperationInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of
+ * results.
+ */
+@Immutable
+public final class OperationListResult implements JsonSerializable {
+ /*
+ * The Operation items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of OperationListResult class.
+ */
+ private OperationListResult() {
+ }
+
+ /**
+ * Get the value property: The Operation items on this page.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: The link to the next page of items.
+ *
+ * @return the nextLink value.
+ */
+ public String nextLink() {
+ return this.nextLink;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property value in model OperationListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the OperationListResult.
+ */
+ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationListResult deserializedOperationListResult = new OperationListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1));
+ deserializedOperationListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedOperationListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationListResult;
+ });
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerListResult.java
new file mode 100644
index 0000000000000..1ab772b008b65
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/SchedulerListResult.java
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.durabletask.fluent.models.SchedulerInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The response of a Scheduler list operation.
+ */
+@Immutable
+public final class SchedulerListResult implements JsonSerializable {
+ /*
+ * The Scheduler items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of SchedulerListResult class.
+ */
+ private SchedulerListResult() {
+ }
+
+ /**
+ * Get the value property: The Scheduler items on this page.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: The link to the next page of items.
+ *
+ * @return the nextLink value.
+ */
+ public String nextLink() {
+ return this.nextLink;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property value in model SchedulerListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(SchedulerListResult.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of SchedulerListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of SchedulerListResult if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the SchedulerListResult.
+ */
+ public static SchedulerListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ SchedulerListResult deserializedSchedulerListResult = new SchedulerListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> SchedulerInner.fromJson(reader1));
+ deserializedSchedulerListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedSchedulerListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedSchedulerListResult;
+ });
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskHubListResult.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskHubListResult.java
new file mode 100644
index 0000000000000..d0cd8685d95c1
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/models/TaskHubListResult.java
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.implementation.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.durabletask.fluent.models.TaskHubInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The response of a TaskHub list operation.
+ */
+@Immutable
+public final class TaskHubListResult implements JsonSerializable {
+ /*
+ * The TaskHub items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of TaskHubListResult class.
+ */
+ private TaskHubListResult() {
+ }
+
+ /**
+ * Get the value property: The TaskHub items on this page.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: The link to the next page of items.
+ *
+ * @return the nextLink value.
+ */
+ public String nextLink() {
+ return this.nextLink;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property value in model TaskHubListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(TaskHubListResult.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of TaskHubListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of TaskHubListResult if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the TaskHubListResult.
+ */
+ public static TaskHubListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ TaskHubListResult deserializedTaskHubListResult = new TaskHubListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> TaskHubInner.fromJson(reader1));
+ deserializedTaskHubListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedTaskHubListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedTaskHubListResult;
+ });
+ }
+}
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/package-info.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/package-info.java
new file mode 100644
index 0000000000000..a20ea1bf903ad
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/implementation/package-info.java
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the implementations for DurableTask.
+ */
+package com.azure.resourcemanager.durabletask.implementation;
diff --git a/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ActionType.java b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ActionType.java
new file mode 100644
index 0000000000000..81e7e501aeb43
--- /dev/null
+++ b/sdk/durabletask/azure-resourcemanager-durabletask/src/main/java/com/azure/resourcemanager/durabletask/models/ActionType.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.durabletask.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+public final class ActionType extends ExpandableStringEnum