diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 342f84b97c16..054c1df553bb 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -300,6 +300,7 @@ com.azure.resourcemanager:azure-resourcemanager-maps;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-botservice;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-recoveryservicesbackup;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-deviceprovisioningservices;1.0.0;1.1.0-beta.1
+com.azure.resourcemanager:azure-resourcemanager-scheduler;1.0.0-beta.1;1.0.0-beta.1
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
# version. Unreleased dependencies are only valid for dependency versions.
diff --git a/pom.xml b/pom.xml
index 8a459dd59a62..30f0219a1112 100644
--- a/pom.xml
+++ b/pom.xml
@@ -707,6 +707,7 @@
eng/code-quality-reports
eng/jacoco-test-coverage
sdk/advisor
+ sdk/agrifood
sdk/anomalydetector
sdk/apimanagement
sdk/appconfiguration
@@ -751,7 +752,6 @@
sdk/digitaltwins
sdk/eventgrid
sdk/eventhubs
- sdk/agrifood
sdk/formrecognizer
sdk/frontdoor
sdk/hanaonazure
@@ -800,6 +800,7 @@
sdk/resourcehealth
sdk/resourcemanager
sdk/resourcemover
+ sdk/scheduler
sdk/schemaregistry
sdk/search
sdk/servicebus
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/CHANGELOG.md b/sdk/scheduler/azure-resourcemanager-scheduler/CHANGELOG.md
new file mode 100644
index 000000000000..a99a329f66e9
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 1.0.0-beta.1 (2021-07-02)
+
+- Azure Resource Manager Scheduler client library for Java. This package contains Microsoft Azure SDK for Scheduler Management SDK. Package tag package-2016-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/README.md b/sdk/scheduler/azure-resourcemanager-scheduler/README.md
new file mode 100644
index 000000000000..ebccd2dcd863
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/README.md
@@ -0,0 +1,101 @@
+# Azure Resource Manager Scheduler client library for Java
+
+Azure Resource Manager Scheduler client library for Java.
+
+This package contains Microsoft Azure SDK for Scheduler Management SDK. Package tag package-2016-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+
+## We'd love to hear your feedback
+
+We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
+
+If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
+
+Thank you in advance for your collaboration. We really appreciate your time!
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+
+## Getting started
+
+### Prerequisites
+
+- [Java Development Kit (JDK)][jdk] with version 8 or above
+- [Azure Subscription][azure_subscription]
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-scheduler;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-scheduler
+ 1.0.0-beta.1
+
+```
+[//]: # ({x-version-update-end})
+
+### Include the recommended packages
+
+Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
+
+[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
+
+### Authentication
+
+By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
+
+- `AZURE_CLIENT_ID` for Azure client ID.
+- `AZURE_TENANT_ID` for Azure tenant ID.
+- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+
+In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
+
+With above configuration, `azure` client can be authenticated by following code:
+
+```java
+AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+TokenCredential credential = new DefaultAzureCredentialBuilder()
+ .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
+ .build();
+SchedulerManager manager = SchedulerManager
+ .authenticate(credential, profile);
+```
+
+The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+
+See [Authentication][authenticate] for more options.
+
+## Key concepts
+
+See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
+
+## Examples
+
+
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://docs.microsoft.com/java/azure/jdk/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity
+[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty
+[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md
+[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/pom.xml b/sdk/scheduler/azure-resourcemanager-scheduler/pom.xml
new file mode 100644
index 000000000000..680d761c26a8
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/pom.xml
@@ -0,0 +1,86 @@
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-scheduler
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for Scheduler Management
+ This package contains Microsoft Azure SDK for Scheduler Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2016-03.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+
+
+
+
+ com.azure
+ azure-core
+ 1.18.0
+
+
+ com.azure
+ azure-core-management
+ 1.3.1
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.5
+
+ true
+
+
+
+ org.revapi
+ revapi-maven-plugin
+ 0.11.2
+
+
+
+ -
+
java.method.addedToInterface
+
+ -
+ true
+
.*
+ com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)*
+
+
+
+
+
+
+
+
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/SchedulerManager.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/SchedulerManager.java
new file mode 100644
index 000000000000..f87909172f68
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/SchedulerManager.java
@@ -0,0 +1,239 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler;
+
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.scheduler.fluent.SchedulerManagementClient;
+import com.azure.resourcemanager.scheduler.implementation.JobCollectionsImpl;
+import com.azure.resourcemanager.scheduler.implementation.JobsImpl;
+import com.azure.resourcemanager.scheduler.implementation.SchedulerManagementClientBuilder;
+import com.azure.resourcemanager.scheduler.models.JobCollections;
+import com.azure.resourcemanager.scheduler.models.Jobs;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** Entry point to SchedulerManager. */
+public final class SchedulerManager {
+ private JobCollections jobCollections;
+
+ private Jobs jobs;
+
+ private final SchedulerManagementClient clientObject;
+
+ private SchedulerManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ this.clientObject =
+ new SchedulerManagementClientBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
+ }
+
+ /**
+ * Creates an instance of Scheduler service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Scheduler service API instance.
+ */
+ public static SchedulerManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return configure().authenticate(credential, profile);
+ }
+
+ /**
+ * Gets a Configurable instance that can be used to create SchedulerManager with optional configuration.
+ *
+ * @return the Configurable instance allowing configurations.
+ */
+ public static Configurable configure() {
+ return new SchedulerManager.Configurable();
+ }
+
+ /** The Configurable allowing configurations to be set. */
+ public static final class Configurable {
+ private final ClientLogger logger = new ClientLogger(Configurable.class);
+
+ private HttpClient httpClient;
+ private HttpLogOptions httpLogOptions;
+ private final List policies = new ArrayList<>();
+ private final List scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * 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 default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of Scheduler service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Scheduler service API instance.
+ */
+ public SchedulerManager 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.scheduler")
+ .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) {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new RequestIdPolicy());
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies.addAll(this.policies);
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new SchedulerManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /** @return Resource collection API of JobCollections. */
+ public JobCollections jobCollections() {
+ if (this.jobCollections == null) {
+ this.jobCollections = new JobCollectionsImpl(clientObject.getJobCollections(), this);
+ }
+ return jobCollections;
+ }
+
+ /** @return Resource collection API of Jobs. */
+ public Jobs jobs() {
+ if (this.jobs == null) {
+ this.jobs = new JobsImpl(clientObject.getJobs(), this);
+ }
+ return jobs;
+ }
+
+ /**
+ * @return Wrapped service client SchedulerManagementClient providing direct access to the underlying auto-generated
+ * API implementation, based on Azure REST API.
+ */
+ public SchedulerManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/JobCollectionsClient.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/JobCollectionsClient.java
new file mode 100644
index 000000000000..87b0c86f7e6f
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/JobCollectionsClient.java
@@ -0,0 +1,317 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.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.scheduler.fluent.models.JobCollectionDefinitionInner;
+
+/** An instance of this class provides access to all the operations defined in JobCollectionsClient. */
+public interface JobCollectionsClient {
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @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 all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @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 all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ JobCollectionDefinitionInner getByResourceGroup(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String jobCollectionName, Context context);
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ JobCollectionDefinitionInner createOrUpdate(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection);
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createOrUpdateWithResponse(
+ String resourceGroupName,
+ String jobCollectionName,
+ JobCollectionDefinitionInner jobCollection,
+ Context context);
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ JobCollectionDefinitionInner patch(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection);
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response patchWithResponse(
+ String resourceGroupName,
+ String jobCollectionName,
+ JobCollectionDefinitionInner jobCollection,
+ Context context);
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String jobCollectionName, Context context);
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 jobCollectionName);
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 jobCollectionName, Context context);
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginEnable(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginEnable(String resourceGroupName, String jobCollectionName, Context context);
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 enable(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 enable(String resourceGroupName, String jobCollectionName, Context context);
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDisable(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDisable(
+ String resourceGroupName, String jobCollectionName, Context context);
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 disable(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 disable(String resourceGroupName, String jobCollectionName, Context context);
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/JobsClient.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/JobsClient.java
new file mode 100644
index 000000000000..9a924d8f60ca
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/JobsClient.java
@@ -0,0 +1,240 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.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.util.Context;
+import com.azure.resourcemanager.scheduler.fluent.models.JobDefinitionInner;
+import com.azure.resourcemanager.scheduler.fluent.models.JobHistoryDefinitionInner;
+
+/** An instance of this class provides access to all the operations defined in JobsClient. */
+public interface JobsClient {
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ JobDefinitionInner get(String resourceGroupName, String jobCollectionName, String jobName);
+
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context);
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ JobDefinitionInner createOrUpdate(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job);
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response createOrUpdateWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job, Context context);
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ JobDefinitionInner patch(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job);
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response patchWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job, Context context);
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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 jobCollectionName, String jobName);
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context);
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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 run(String resourceGroupName, String jobCollectionName, String jobName);
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response runWithResponse(String resourceGroupName, String jobCollectionName, String jobName, Context context);
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String jobCollectionName);
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param top The number of jobs to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter, Context context);
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listJobHistory(
+ String resourceGroupName, String jobCollectionName, String jobName);
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param top the number of job history to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listJobHistory(
+ String resourceGroupName,
+ String jobCollectionName,
+ String jobName,
+ Integer top,
+ Integer skip,
+ String filter,
+ Context context);
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/SchedulerManagementClient.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/SchedulerManagementClient.java
new file mode 100644
index 000000000000..4b7418011d94
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/SchedulerManagementClient.java
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for SchedulerManagementClient class. */
+public interface SchedulerManagementClient {
+ /**
+ * Gets The subscription id.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the JobCollectionsClient object to access its operations.
+ *
+ * @return the JobCollectionsClient object.
+ */
+ JobCollectionsClient getJobCollections();
+
+ /**
+ * Gets the JobsClient object to access its operations.
+ *
+ * @return the JobsClient object.
+ */
+ JobsClient getJobs();
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobCollectionDefinitionInner.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobCollectionDefinitionInner.java
new file mode 100644
index 000000000000..358bfb123141
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobCollectionDefinitionInner.java
@@ -0,0 +1,163 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.scheduler.models.JobCollectionProperties;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** The JobCollectionDefinition model. */
+@Fluent
+public final class JobCollectionDefinitionInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(JobCollectionDefinitionInner.class);
+
+ /*
+ * Gets the job collection resource identifier.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * Gets the job collection resource type.
+ */
+ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
+ private String type;
+
+ /*
+ * Gets or sets the job collection resource name.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Gets or sets the storage account location.
+ */
+ @JsonProperty(value = "location")
+ private String location;
+
+ /*
+ * Gets or sets the tags.
+ */
+ @JsonProperty(value = "tags")
+ private Map tags;
+
+ /*
+ * Gets or sets the job collection properties.
+ */
+ @JsonProperty(value = "properties")
+ private JobCollectionProperties properties;
+
+ /**
+ * Get the id property: Gets the job collection resource identifier.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the type property: Gets the job collection resource type.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: Gets or sets the job collection resource name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Gets or sets the job collection resource name.
+ *
+ * @param name the name value to set.
+ * @return the JobCollectionDefinitionInner object itself.
+ */
+ public JobCollectionDefinitionInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the location property: Gets or sets the storage account location.
+ *
+ * @return the location value.
+ */
+ public String location() {
+ return this.location;
+ }
+
+ /**
+ * Set the location property: Gets or sets the storage account location.
+ *
+ * @param location the location value to set.
+ * @return the JobCollectionDefinitionInner object itself.
+ */
+ public JobCollectionDefinitionInner withLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ /**
+ * Get the tags property: Gets or sets the tags.
+ *
+ * @return the tags value.
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: Gets or sets the tags.
+ *
+ * @param tags the tags value to set.
+ * @return the JobCollectionDefinitionInner object itself.
+ */
+ public JobCollectionDefinitionInner withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Get the properties property: Gets or sets the job collection properties.
+ *
+ * @return the properties value.
+ */
+ public JobCollectionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Gets or sets the job collection properties.
+ *
+ * @param properties the properties value to set.
+ * @return the JobCollectionDefinitionInner object itself.
+ */
+ public JobCollectionDefinitionInner withProperties(JobCollectionProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobDefinitionInner.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobDefinitionInner.java
new file mode 100644
index 000000000000..fab24afe512d
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobDefinitionInner.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.scheduler.models.JobProperties;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The JobDefinition model. */
+@Fluent
+public final class JobDefinitionInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(JobDefinitionInner.class);
+
+ /*
+ * Gets the job resource identifier.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * Gets the job resource type.
+ */
+ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
+ private String type;
+
+ /*
+ * Gets the job resource name.
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Gets or sets the job properties.
+ */
+ @JsonProperty(value = "properties")
+ private JobProperties properties;
+
+ /**
+ * Get the id property: Gets the job resource identifier.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the type property: Gets the job resource type.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: Gets the job resource name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the properties property: Gets or sets the job properties.
+ *
+ * @return the properties value.
+ */
+ public JobProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: Gets or sets the job properties.
+ *
+ * @param properties the properties value to set.
+ * @return the JobDefinitionInner object itself.
+ */
+ public JobDefinitionInner withProperties(JobProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobHistoryDefinitionInner.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobHistoryDefinitionInner.java
new file mode 100644
index 000000000000..8c198ae5c912
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/JobHistoryDefinitionInner.java
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.scheduler.models.JobHistoryDefinitionProperties;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The JobHistoryDefinition model. */
+@Immutable
+public final class JobHistoryDefinitionInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(JobHistoryDefinitionInner.class);
+
+ /*
+ * Gets the job history identifier.
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * Gets the job history resource type.
+ */
+ @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
+ private String type;
+
+ /*
+ * Gets the job history name.
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Gets or sets the job history properties.
+ */
+ @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY)
+ private JobHistoryDefinitionProperties properties;
+
+ /**
+ * Get the id property: Gets the job history identifier.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the type property: Gets the job history resource type.
+ *
+ * @return the type value.
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: Gets the job history name.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the properties property: Gets or sets the job history properties.
+ *
+ * @return the properties value.
+ */
+ public JobHistoryDefinitionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/package-info.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/package-info.java
new file mode 100644
index 000000000000..9bdb0100b81a
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/models/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the inner data models for SchedulerManagementClient. null. */
+package com.azure.resourcemanager.scheduler.fluent.models;
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/package-info.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/package-info.java
new file mode 100644
index 000000000000..b65714ae2851
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/fluent/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the service clients for SchedulerManagementClient. null. */
+package com.azure.resourcemanager.scheduler.fluent;
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionDefinitionImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionDefinitionImpl.java
new file mode 100644
index 000000000000..2d2c20e07293
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionDefinitionImpl.java
@@ -0,0 +1,193 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.scheduler.fluent.models.JobCollectionDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobCollectionDefinition;
+import com.azure.resourcemanager.scheduler.models.JobCollectionProperties;
+import java.util.Collections;
+import java.util.Map;
+
+public final class JobCollectionDefinitionImpl
+ implements JobCollectionDefinition, JobCollectionDefinition.Definition, JobCollectionDefinition.Update {
+ private JobCollectionDefinitionInner innerObject;
+
+ private final com.azure.resourcemanager.scheduler.SchedulerManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ 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 JobCollectionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public JobCollectionDefinitionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.scheduler.SchedulerManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String jobCollectionName;
+
+ public JobCollectionDefinitionImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public JobCollectionDefinition create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobCollections()
+ .createOrUpdateWithResponse(resourceGroupName, jobCollectionName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public JobCollectionDefinition create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobCollections()
+ .createOrUpdateWithResponse(resourceGroupName, jobCollectionName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ JobCollectionDefinitionImpl(String name, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerObject = new JobCollectionDefinitionInner();
+ this.serviceManager = serviceManager;
+ this.jobCollectionName = name;
+ }
+
+ public JobCollectionDefinitionImpl update() {
+ return this;
+ }
+
+ public JobCollectionDefinition apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobCollections()
+ .patchWithResponse(resourceGroupName, jobCollectionName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public JobCollectionDefinition apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobCollections()
+ .patchWithResponse(resourceGroupName, jobCollectionName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ JobCollectionDefinitionImpl(
+ JobCollectionDefinitionInner innerObject, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.jobCollectionName = Utils.getValueFromIdByName(innerObject.id(), "jobCollections");
+ }
+
+ public JobCollectionDefinition refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobCollections()
+ .getByResourceGroupWithResponse(resourceGroupName, jobCollectionName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public JobCollectionDefinition refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobCollections()
+ .getByResourceGroupWithResponse(resourceGroupName, jobCollectionName, context)
+ .getValue();
+ return this;
+ }
+
+ public void enable() {
+ serviceManager.jobCollections().enable(resourceGroupName, jobCollectionName);
+ }
+
+ public void enable(Context context) {
+ serviceManager.jobCollections().enable(resourceGroupName, jobCollectionName, context);
+ }
+
+ public void disable() {
+ serviceManager.jobCollections().disable(resourceGroupName, jobCollectionName);
+ }
+
+ public void disable(Context context) {
+ serviceManager.jobCollections().disable(resourceGroupName, jobCollectionName, context);
+ }
+
+ public JobCollectionDefinitionImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public JobCollectionDefinitionImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public JobCollectionDefinitionImpl withTags(Map tags) {
+ this.innerModel().withTags(tags);
+ return this;
+ }
+
+ public JobCollectionDefinitionImpl withName(String name) {
+ this.innerModel().withName(name);
+ return this;
+ }
+
+ public JobCollectionDefinitionImpl withProperties(JobCollectionProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionsClientImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionsClientImpl.java
new file mode 100644
index 000000000000..998b48f2d738
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionsClientImpl.java
@@ -0,0 +1,1843 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.scheduler.fluent.JobCollectionsClient;
+import com.azure.resourcemanager.scheduler.fluent.models.JobCollectionDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobCollectionListResult;
+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 JobCollectionsClient. */
+public final class JobCollectionsClientImpl implements JobCollectionsClient {
+ private final ClientLogger logger = new ClientLogger(JobCollectionsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final JobCollectionsService service;
+
+ /** The service client containing this operation class. */
+ private final SchedulerManagementClientImpl client;
+
+ /**
+ * Initializes an instance of JobCollectionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ JobCollectionsClientImpl(SchedulerManagementClientImpl client) {
+ this.service =
+ RestProxy.create(JobCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SchedulerManagementClientJobCollections to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SchedulerManagementC")
+ private interface JobCollectionsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") JobCollectionDefinitionInner jobCollection,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> patch(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") JobCollectionDefinitionInner jobCollection,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/enable")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> enable(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/disable")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> disable(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Gets all job collections under specified 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 all job collections under specified subscription.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @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 all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @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 all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(
+ String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Gets all job collections under specified resource group.
+ *
+ * @param resourceGroupName The resource group name.
+ * @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 all job collections under specified resource group.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String jobCollectionName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(
+ String resourceGroupName, String jobCollectionName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, jobCollectionName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public JobCollectionDefinitionInner getByResourceGroup(String resourceGroupName, String jobCollectionName) {
+ return getByResourceGroupAsync(resourceGroupName, jobCollectionName).block();
+ }
+
+ /**
+ * Gets a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 job collection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, jobCollectionName, context).block();
+ }
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobCollection == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobCollection is required and cannot be null."));
+ } else {
+ jobCollection.validate();
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ jobCollection,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String jobCollectionName,
+ JobCollectionDefinitionInner jobCollection,
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobCollection == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobCollection is required and cannot be null."));
+ } else {
+ jobCollection.validate();
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ jobCollection,
+ accept,
+ context);
+ }
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, jobCollectionName, jobCollection)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public JobCollectionDefinitionInner createOrUpdate(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) {
+ return createOrUpdateAsync(resourceGroupName, jobCollectionName, jobCollection).block();
+ }
+
+ /**
+ * Provisions a new job collection or updates an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createOrUpdateWithResponse(
+ String resourceGroupName,
+ String jobCollectionName,
+ JobCollectionDefinitionInner jobCollection,
+ Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, jobCollectionName, jobCollection, context).block();
+ }
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> patchWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobCollection == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobCollection is required and cannot be null."));
+ } else {
+ jobCollection.validate();
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .patch(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ jobCollection,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> patchWithResponseAsync(
+ String resourceGroupName,
+ String jobCollectionName,
+ JobCollectionDefinitionInner jobCollection,
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobCollection == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobCollection is required and cannot be null."));
+ } else {
+ jobCollection.validate();
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .patch(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ jobCollection,
+ accept,
+ context);
+ }
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono patchAsync(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) {
+ return patchWithResponseAsync(resourceGroupName, jobCollectionName, jobCollection)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public JobCollectionDefinitionInner patch(
+ String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) {
+ return patchAsync(resourceGroupName, jobCollectionName, jobCollection).block();
+ }
+
+ /**
+ * Patches an existing job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobCollection The job collection definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response patchWithResponse(
+ String resourceGroupName,
+ String jobCollectionName,
+ JobCollectionDefinitionInner jobCollection,
+ Context context) {
+ return patchWithResponseAsync(resourceGroupName, jobCollectionName, jobCollection, context).block();
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String jobCollectionName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ context);
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String jobCollectionName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobCollectionName);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobCollectionName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String jobCollectionName) {
+ return beginDeleteAsync(resourceGroupName, jobCollectionName).getSyncPoller();
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ return beginDeleteAsync(resourceGroupName, jobCollectionName, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String jobCollectionName) {
+ return beginDeleteAsync(resourceGroupName, jobCollectionName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String jobCollectionName, Context context) {
+ return beginDeleteAsync(resourceGroupName, jobCollectionName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 jobCollectionName) {
+ deleteAsync(resourceGroupName, jobCollectionName).block();
+ }
+
+ /**
+ * Deletes a job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 jobCollectionName, Context context) {
+ deleteAsync(resourceGroupName, jobCollectionName, context).block();
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> enableWithResponseAsync(
+ String resourceGroupName, String jobCollectionName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .enable(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> enableWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .enable(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ context);
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginEnableAsync(String resourceGroupName, String jobCollectionName) {
+ Mono>> mono = enableWithResponseAsync(resourceGroupName, jobCollectionName);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginEnableAsync(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = enableWithResponseAsync(resourceGroupName, jobCollectionName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginEnable(String resourceGroupName, String jobCollectionName) {
+ return beginEnableAsync(resourceGroupName, jobCollectionName).getSyncPoller();
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginEnable(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ return beginEnableAsync(resourceGroupName, jobCollectionName, context).getSyncPoller();
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono enableAsync(String resourceGroupName, String jobCollectionName) {
+ return beginEnableAsync(resourceGroupName, jobCollectionName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono enableAsync(String resourceGroupName, String jobCollectionName, Context context) {
+ return beginEnableAsync(resourceGroupName, jobCollectionName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 enable(String resourceGroupName, String jobCollectionName) {
+ enableAsync(resourceGroupName, jobCollectionName).block();
+ }
+
+ /**
+ * Enables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 enable(String resourceGroupName, String jobCollectionName, Context context) {
+ enableAsync(resourceGroupName, jobCollectionName, context).block();
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> disableWithResponseAsync(
+ String resourceGroupName, String jobCollectionName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .disable(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> disableWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .disable(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ context);
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDisableAsync(String resourceGroupName, String jobCollectionName) {
+ Mono>> mono = disableWithResponseAsync(resourceGroupName, jobCollectionName);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDisableAsync(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = disableWithResponseAsync(resourceGroupName, jobCollectionName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDisable(String resourceGroupName, String jobCollectionName) {
+ return beginDisableAsync(resourceGroupName, jobCollectionName).getSyncPoller();
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDisable(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ return beginDisableAsync(resourceGroupName, jobCollectionName, context).getSyncPoller();
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono disableAsync(String resourceGroupName, String jobCollectionName) {
+ return beginDisableAsync(resourceGroupName, jobCollectionName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono disableAsync(String resourceGroupName, String jobCollectionName, Context context) {
+ return beginDisableAsync(resourceGroupName, jobCollectionName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 disable(String resourceGroupName, String jobCollectionName) {
+ disableAsync(resourceGroupName, jobCollectionName).block();
+ }
+
+ /**
+ * Disables all of the jobs in the job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @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 disable(String resourceGroupName, String jobCollectionName, Context context) {
+ disableAsync(resourceGroupName, jobCollectionName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @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, text/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @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, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @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, text/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @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, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionsImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionsImpl.java
new file mode 100644
index 000000000000..b6c015aff422
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobCollectionsImpl.java
@@ -0,0 +1,192 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.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.scheduler.fluent.JobCollectionsClient;
+import com.azure.resourcemanager.scheduler.fluent.models.JobCollectionDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobCollectionDefinition;
+import com.azure.resourcemanager.scheduler.models.JobCollections;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class JobCollectionsImpl implements JobCollections {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(JobCollectionsImpl.class);
+
+ private final JobCollectionsClient innerClient;
+
+ private final com.azure.resourcemanager.scheduler.SchedulerManager serviceManager;
+
+ public JobCollectionsImpl(
+ JobCollectionsClient innerClient, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new JobCollectionDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new JobCollectionDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new JobCollectionDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new JobCollectionDefinitionImpl(inner1, this.manager()));
+ }
+
+ public JobCollectionDefinition getByResourceGroup(String resourceGroupName, String jobCollectionName) {
+ JobCollectionDefinitionInner inner =
+ this.serviceClient().getByResourceGroup(resourceGroupName, jobCollectionName);
+ if (inner != null) {
+ return new JobCollectionDefinitionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String jobCollectionName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, jobCollectionName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new JobCollectionDefinitionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String jobCollectionName) {
+ this.serviceClient().delete(resourceGroupName, jobCollectionName);
+ }
+
+ public void delete(String resourceGroupName, String jobCollectionName, Context context) {
+ this.serviceClient().delete(resourceGroupName, jobCollectionName, context);
+ }
+
+ public void enable(String resourceGroupName, String jobCollectionName) {
+ this.serviceClient().enable(resourceGroupName, jobCollectionName);
+ }
+
+ public void enable(String resourceGroupName, String jobCollectionName, Context context) {
+ this.serviceClient().enable(resourceGroupName, jobCollectionName, context);
+ }
+
+ public void disable(String resourceGroupName, String jobCollectionName) {
+ this.serviceClient().disable(resourceGroupName, jobCollectionName);
+ }
+
+ public void disable(String resourceGroupName, String jobCollectionName, Context context) {
+ this.serviceClient().disable(resourceGroupName, jobCollectionName, context);
+ }
+
+ public JobCollectionDefinition getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, jobCollectionName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, jobCollectionName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ this.delete(resourceGroupName, jobCollectionName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ this.delete(resourceGroupName, jobCollectionName, context);
+ }
+
+ private JobCollectionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.scheduler.SchedulerManager manager() {
+ return this.serviceManager;
+ }
+
+ public JobCollectionDefinitionImpl define(String name) {
+ return new JobCollectionDefinitionImpl(name, this.manager());
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobDefinitionImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobDefinitionImpl.java
new file mode 100644
index 000000000000..2d89632aa445
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobDefinitionImpl.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.scheduler.fluent.models.JobDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobDefinition;
+import com.azure.resourcemanager.scheduler.models.JobProperties;
+
+public final class JobDefinitionImpl implements JobDefinition, JobDefinition.Definition, JobDefinition.Update {
+ private JobDefinitionInner innerObject;
+
+ private final com.azure.resourcemanager.scheduler.SchedulerManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public JobProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public JobDefinitionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.scheduler.SchedulerManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String jobCollectionName;
+
+ private String jobName;
+
+ public JobDefinitionImpl withExistingJobCollection(String resourceGroupName, String jobCollectionName) {
+ this.resourceGroupName = resourceGroupName;
+ this.jobCollectionName = jobCollectionName;
+ return this;
+ }
+
+ public JobDefinition create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobs()
+ .createOrUpdateWithResponse(
+ resourceGroupName, jobCollectionName, jobName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public JobDefinition create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobs()
+ .createOrUpdateWithResponse(resourceGroupName, jobCollectionName, jobName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ JobDefinitionImpl(String name, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerObject = new JobDefinitionInner();
+ this.serviceManager = serviceManager;
+ this.jobName = name;
+ }
+
+ public JobDefinitionImpl update() {
+ return this;
+ }
+
+ public JobDefinition apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobs()
+ .patchWithResponse(resourceGroupName, jobCollectionName, jobName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public JobDefinition apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobs()
+ .patchWithResponse(resourceGroupName, jobCollectionName, jobName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ JobDefinitionImpl(
+ JobDefinitionInner innerObject, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.jobCollectionName = Utils.getValueFromIdByName(innerObject.id(), "jobCollections");
+ this.jobName = Utils.getValueFromIdByName(innerObject.id(), "jobs");
+ }
+
+ public JobDefinition refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobs()
+ .getWithResponse(resourceGroupName, jobCollectionName, jobName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public JobDefinition refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getJobs()
+ .getWithResponse(resourceGroupName, jobCollectionName, jobName, context)
+ .getValue();
+ return this;
+ }
+
+ public void run() {
+ serviceManager.jobs().run(resourceGroupName, jobCollectionName, jobName);
+ }
+
+ public Response runWithResponse(Context context) {
+ return serviceManager.jobs().runWithResponse(resourceGroupName, jobCollectionName, jobName, context);
+ }
+
+ public JobDefinitionImpl withProperties(JobProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobHistoryDefinitionImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobHistoryDefinitionImpl.java
new file mode 100644
index 000000000000..8507173dc059
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobHistoryDefinitionImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.resourcemanager.scheduler.fluent.models.JobHistoryDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobHistoryDefinition;
+import com.azure.resourcemanager.scheduler.models.JobHistoryDefinitionProperties;
+
+public final class JobHistoryDefinitionImpl implements JobHistoryDefinition {
+ private JobHistoryDefinitionInner innerObject;
+
+ private final com.azure.resourcemanager.scheduler.SchedulerManager serviceManager;
+
+ JobHistoryDefinitionImpl(
+ JobHistoryDefinitionInner innerObject, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public JobHistoryDefinitionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public JobHistoryDefinitionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.scheduler.SchedulerManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobsClientImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobsClientImpl.java
new file mode 100644
index 000000000000..11d643abb602
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobsClientImpl.java
@@ -0,0 +1,1675 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.scheduler.fluent.JobsClient;
+import com.azure.resourcemanager.scheduler.fluent.models.JobDefinitionInner;
+import com.azure.resourcemanager.scheduler.fluent.models.JobHistoryDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobHistoryListResult;
+import com.azure.resourcemanager.scheduler.models.JobListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in JobsClient. */
+public final class JobsClientImpl implements JobsClient {
+ private final ClientLogger logger = new ClientLogger(JobsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final JobsService service;
+
+ /** The service client containing this operation class. */
+ private final SchedulerManagementClientImpl client;
+
+ /**
+ * Initializes an instance of JobsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ JobsClientImpl(SchedulerManagementClientImpl client) {
+ this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for SchedulerManagementClientJobs to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "SchedulerManagementC")
+ private interface JobsService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs/{jobName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @PathParam("jobName") String jobName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs/{jobName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @PathParam("jobName") String jobName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") JobDefinitionInner job,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs/{jobName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> patch(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @PathParam("jobName") String jobName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") JobDefinitionInner job,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs/{jobName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @PathParam("jobName") String jobName,
+ @QueryParam("api-version") String apiVersion,
+ Context context);
+
+ @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs/{jobName}/run")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> run(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @PathParam("jobName") String jobName,
+ @QueryParam("api-version") String apiVersion,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("$top") Integer top,
+ @QueryParam("$skip") Integer skip,
+ @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler"
+ + "/jobCollections/{jobCollectionName}/jobs/{jobName}/history")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listJobHistory(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("jobCollectionName") String jobCollectionName,
+ @PathParam("jobName") String jobName,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("$top") Integer top,
+ @QueryParam("$skip") Integer skip,
+ @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listJobHistoryNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String jobCollectionName, String jobName) {
+ return getWithResponseAsync(resourceGroupName, jobCollectionName, jobName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public JobDefinitionInner get(String resourceGroupName, String jobCollectionName, String jobName) {
+ return getAsync(resourceGroupName, jobCollectionName, jobName).block();
+ }
+
+ /**
+ * Gets a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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 job.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context) {
+ return getWithResponseAsync(resourceGroupName, jobCollectionName, jobName, context).block();
+ }
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ if (job == null) {
+ return Mono.error(new IllegalArgumentException("Parameter job is required and cannot be null."));
+ } else {
+ job.validate();
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ job,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ if (job == null) {
+ return Mono.error(new IllegalArgumentException("Parameter job is required and cannot be null."));
+ } else {
+ job.validate();
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ job,
+ accept,
+ context);
+ }
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, jobCollectionName, jobName, job)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public JobDefinitionInner createOrUpdate(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job) {
+ return createOrUpdateAsync(resourceGroupName, jobCollectionName, jobName, job).block();
+ }
+
+ /**
+ * Provisions a new job or updates an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createOrUpdateWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job, Context context) {
+ return createOrUpdateWithResponseAsync(resourceGroupName, jobCollectionName, jobName, job, context).block();
+ }
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> patchWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ if (job == null) {
+ return Mono.error(new IllegalArgumentException("Parameter job is required and cannot be null."));
+ } else {
+ job.validate();
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .patch(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ job,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> patchWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ if (job == null) {
+ return Mono.error(new IllegalArgumentException("Parameter job is required and cannot be null."));
+ } else {
+ job.validate();
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .patch(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ job,
+ accept,
+ context);
+ }
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono patchAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job) {
+ return patchWithResponseAsync(resourceGroupName, jobCollectionName, jobName, job)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public JobDefinitionInner patch(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job) {
+ return patchAsync(resourceGroupName, jobCollectionName, jobName, job).block();
+ }
+
+ /**
+ * Patches an existing job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param job The job definition.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response patchWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, JobDefinitionInner job, Context context) {
+ return patchWithResponseAsync(resourceGroupName, jobCollectionName, jobName, job, context).block();
+ }
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ context);
+ }
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String jobCollectionName, String jobName) {
+ return deleteWithResponseAsync(resourceGroupName, jobCollectionName, jobName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 jobCollectionName, String jobName) {
+ deleteAsync(resourceGroupName, jobCollectionName, jobName).block();
+ }
+
+ /**
+ * Deletes a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, jobCollectionName, jobName, context).block();
+ }
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> runWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .run(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> runWithResponseAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ context = this.client.mergeContext(context);
+ return service
+ .run(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ context);
+ }
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono runAsync(String resourceGroupName, String jobCollectionName, String jobName) {
+ return runWithResponseAsync(resourceGroupName, jobCollectionName, jobName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 run(String resourceGroupName, String jobCollectionName, String jobName) {
+ runAsync(resourceGroupName, jobCollectionName, jobName).block();
+ }
+
+ /**
+ * Runs a job.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response runWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context) {
+ return runWithResponseAsync(resourceGroupName, jobCollectionName, jobName, context).block();
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param top The number of jobs to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ top,
+ skip,
+ filter,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param top The number of jobs to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ this.client.getApiVersion(),
+ top,
+ skip,
+ filter,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param top The number of jobs to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, jobCollectionName, top, skip, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String resourceGroupName, String jobCollectionName) {
+ final Integer top = null;
+ final Integer skip = null;
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, jobCollectionName, top, skip, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param top The number of jobs to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, jobCollectionName, top, skip, filter, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String jobCollectionName) {
+ final Integer top = null;
+ final Integer skip = null;
+ final String filter = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, jobCollectionName, top, skip, filter));
+ }
+
+ /**
+ * Lists all jobs under the specified job collection.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param top The number of jobs to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter, Context context) {
+ return new PagedIterable<>(listAsync(resourceGroupName, jobCollectionName, top, skip, filter, context));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param top the number of job history to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listJobHistorySinglePageAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, Integer top, Integer skip, String filter) {
+ 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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listJobHistory(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ top,
+ skip,
+ filter,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param top the number of job history to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listJobHistorySinglePageAsync(
+ String resourceGroupName,
+ String jobCollectionName,
+ String jobName,
+ Integer top,
+ Integer skip,
+ String filter,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (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 (jobCollectionName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."));
+ }
+ if (jobName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null."));
+ }
+ final String accept = "application/json, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listJobHistory(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ jobCollectionName,
+ jobName,
+ this.client.getApiVersion(),
+ top,
+ skip,
+ filter,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param top the number of job history to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listJobHistoryAsync(
+ String resourceGroupName, String jobCollectionName, String jobName, Integer top, Integer skip, String filter) {
+ return new PagedFlux<>(
+ () -> listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter),
+ nextLink -> listJobHistoryNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listJobHistoryAsync(
+ String resourceGroupName, String jobCollectionName, String jobName) {
+ final Integer top = null;
+ final Integer skip = null;
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter),
+ nextLink -> listJobHistoryNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param top the number of job history to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listJobHistoryAsync(
+ String resourceGroupName,
+ String jobCollectionName,
+ String jobName,
+ Integer top,
+ Integer skip,
+ String filter,
+ Context context) {
+ return new PagedFlux<>(
+ () ->
+ listJobHistorySinglePageAsync(
+ resourceGroupName, jobCollectionName, jobName, top, skip, filter, context),
+ nextLink -> listJobHistoryNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listJobHistory(
+ String resourceGroupName, String jobCollectionName, String jobName) {
+ final Integer top = null;
+ final Integer skip = null;
+ final String filter = null;
+ return new PagedIterable<>(
+ listJobHistoryAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter));
+ }
+
+ /**
+ * Lists job history.
+ *
+ * @param resourceGroupName The resource group name.
+ * @param jobCollectionName The job collection name.
+ * @param jobName The job name.
+ * @param top the number of job history to request, in the of range of [1..100].
+ * @param skip The (0-based) index of the job history list from which to begin requesting entries.
+ * @param filter The filter to apply on the job state.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listJobHistory(
+ String resourceGroupName,
+ String jobCollectionName,
+ String jobName,
+ Integer top,
+ Integer skip,
+ String filter,
+ Context context) {
+ return new PagedIterable<>(
+ listJobHistoryAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @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, text/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 nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @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, text/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));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listJobHistoryNextSinglePageAsync(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, text/json";
+ return FluxUtil
+ .withContext(context -> service.listJobHistoryNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listJobHistoryNextSinglePageAsync(
+ 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, text/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listJobHistoryNext(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/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobsImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobsImpl.java
new file mode 100644
index 000000000000..c919271f2553
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/JobsImpl.java
@@ -0,0 +1,227 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.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.scheduler.fluent.JobsClient;
+import com.azure.resourcemanager.scheduler.fluent.models.JobDefinitionInner;
+import com.azure.resourcemanager.scheduler.fluent.models.JobHistoryDefinitionInner;
+import com.azure.resourcemanager.scheduler.models.JobDefinition;
+import com.azure.resourcemanager.scheduler.models.JobHistoryDefinition;
+import com.azure.resourcemanager.scheduler.models.Jobs;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class JobsImpl implements Jobs {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(JobsImpl.class);
+
+ private final JobsClient innerClient;
+
+ private final com.azure.resourcemanager.scheduler.SchedulerManager serviceManager;
+
+ public JobsImpl(JobsClient innerClient, com.azure.resourcemanager.scheduler.SchedulerManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public JobDefinition get(String resourceGroupName, String jobCollectionName, String jobName) {
+ JobDefinitionInner inner = this.serviceClient().get(resourceGroupName, jobCollectionName, jobName);
+ if (inner != null) {
+ return new JobDefinitionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, jobCollectionName, jobName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new JobDefinitionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String resourceGroupName, String jobCollectionName, String jobName) {
+ this.serviceClient().delete(resourceGroupName, jobCollectionName, jobName);
+ }
+
+ public Response deleteWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, jobCollectionName, jobName, context);
+ }
+
+ public void run(String resourceGroupName, String jobCollectionName, String jobName) {
+ this.serviceClient().run(resourceGroupName, jobCollectionName, jobName);
+ }
+
+ public Response runWithResponse(
+ String resourceGroupName, String jobCollectionName, String jobName, Context context) {
+ return this.serviceClient().runWithResponse(resourceGroupName, jobCollectionName, jobName, context);
+ }
+
+ public PagedIterable list(String resourceGroupName, String jobCollectionName) {
+ PagedIterable inner = this.serviceClient().list(resourceGroupName, jobCollectionName);
+ return Utils.mapPage(inner, inner1 -> new JobDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(
+ String resourceGroupName, String jobCollectionName, Integer top, Integer skip, String filter, Context context) {
+ PagedIterable inner =
+ this.serviceClient().list(resourceGroupName, jobCollectionName, top, skip, filter, context);
+ return Utils.mapPage(inner, inner1 -> new JobDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listJobHistory(
+ String resourceGroupName, String jobCollectionName, String jobName) {
+ PagedIterable inner =
+ this.serviceClient().listJobHistory(resourceGroupName, jobCollectionName, jobName);
+ return Utils.mapPage(inner, inner1 -> new JobHistoryDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listJobHistory(
+ String resourceGroupName,
+ String jobCollectionName,
+ String jobName,
+ Integer top,
+ Integer skip,
+ String filter,
+ Context context) {
+ PagedIterable inner =
+ this
+ .serviceClient()
+ .listJobHistory(resourceGroupName, jobCollectionName, jobName, top, skip, filter, context);
+ return Utils.mapPage(inner, inner1 -> new JobHistoryDefinitionImpl(inner1, this.manager()));
+ }
+
+ public JobDefinition getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ String jobName = Utils.getValueFromIdByName(id, "jobs");
+ if (jobName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, jobCollectionName, jobName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ String jobName = Utils.getValueFromIdByName(id, "jobs");
+ if (jobName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, jobCollectionName, jobName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ String jobName = Utils.getValueFromIdByName(id, "jobs");
+ if (jobName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id)));
+ }
+ this.deleteWithResponse(resourceGroupName, jobCollectionName, jobName, Context.NONE).getValue();
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String jobCollectionName = Utils.getValueFromIdByName(id, "jobCollections");
+ if (jobCollectionName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'jobCollections'.", id)));
+ }
+ String jobName = Utils.getValueFromIdByName(id, "jobs");
+ if (jobName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id)));
+ }
+ return this.deleteWithResponse(resourceGroupName, jobCollectionName, jobName, context);
+ }
+
+ private JobsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.scheduler.SchedulerManager manager() {
+ return this.serviceManager;
+ }
+
+ public JobDefinitionImpl define(String name) {
+ return new JobDefinitionImpl(name, this.manager());
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/SchedulerManagementClientBuilder.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/SchedulerManagementClientBuilder.java
new file mode 100644
index 000000000000..88694c3954d2
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/SchedulerManagementClientBuilder.java
@@ -0,0 +1,146 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.CookiePolicy;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/** A builder for creating a new instance of the SchedulerManagementClientImpl type. */
+@ServiceClientBuilder(serviceClients = {SchedulerManagementClientImpl.class})
+public final class SchedulerManagementClientBuilder {
+ /*
+ * The subscription id.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The subscription id.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the SchedulerManagementClientBuilder.
+ */
+ public SchedulerManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the SchedulerManagementClientBuilder.
+ */
+ public SchedulerManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the SchedulerManagementClientBuilder.
+ */
+ public SchedulerManagementClientBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the SchedulerManagementClientBuilder.
+ */
+ public SchedulerManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the SchedulerManagementClientBuilder.
+ */
+ public SchedulerManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the SchedulerManagementClientBuilder.
+ */
+ public SchedulerManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of SchedulerManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of SchedulerManagementClientImpl.
+ */
+ public SchedulerManagementClientImpl buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ if (pipeline == null) {
+ this.pipeline =
+ new HttpPipelineBuilder()
+ .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
+ .build();
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
+ }
+ SchedulerManagementClientImpl client =
+ new SchedulerManagementClientImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/SchedulerManagementClientImpl.java b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/SchedulerManagementClientImpl.java
new file mode 100644
index 000000000000..816fa1ca4b68
--- /dev/null
+++ b/sdk/scheduler/azure-resourcemanager-scheduler/src/main/java/com/azure/resourcemanager/scheduler/implementation/SchedulerManagementClientImpl.java
@@ -0,0 +1,307 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scheduler.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.scheduler.fluent.JobCollectionsClient;
+import com.azure.resourcemanager.scheduler.fluent.JobsClient;
+import com.azure.resourcemanager.scheduler.fluent.SchedulerManagementClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import java.util.Map;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** Initializes a new instance of the SchedulerManagementClientImpl type. */
+@ServiceClient(builder = SchedulerManagementClientBuilder.class)
+public final class SchedulerManagementClientImpl implements SchedulerManagementClient {
+ private final ClientLogger logger = new ClientLogger(SchedulerManagementClientImpl.class);
+
+ /** The subscription id. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The subscription id.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The JobCollectionsClient object to access its operations. */
+ private final JobCollectionsClient jobCollections;
+
+ /**
+ * Gets the JobCollectionsClient object to access its operations.
+ *
+ * @return the JobCollectionsClient object.
+ */
+ public JobCollectionsClient getJobCollections() {
+ return this.jobCollections;
+ }
+
+ /** The JobsClient object to access its operations. */
+ private final JobsClient jobs;
+
+ /**
+ * Gets the JobsClient object to access its operations.
+ *
+ * @return the JobsClient object.
+ */
+ public JobsClient getJobs() {
+ return this.jobs;
+ }
+
+ /**
+ * Initializes an instance of SchedulerManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The subscription id.
+ * @param endpoint server parameter.
+ */
+ SchedulerManagementClientImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2016-03-01";
+ this.jobCollections = new JobCollectionsClientImpl(this);
+ this.jobs = new JobsClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ for (Map.Entry