diff --git a/azure-hdinsight-job/pom.xml b/azure-hdinsight-job/pom.xml
new file mode 100644
index 000000000000..5a08f99f7fe9
--- /dev/null
+++ b/azure-hdinsight-job/pom.xml
@@ -0,0 +1,115 @@
+
+
+ 4.0.0
+ com.microsoft.azure
+ azure-
+ 1.7.1-SNAPSHOT
+ jar
+ Microsoft Azure SDK for
+ This package contains Microsoft SDK.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+ scm:git:https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+ UTF-8
+
+
+
+
+ microsoft
+ Microsoft
+
+
+
+
+ com.microsoft.azure
+ azure-client-runtime
+ 1.5.3
+
+
+ junit
+ junit
+ 4.12
+ test
+
+
+ com.microsoft.azure
+ azure-client-authentication
+ 1.5.3
+ test
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ true
+ true
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+ 1.7
+ 1.7
+
+
+ com.microsoft.azure.management.apigeneration.LangDefinitionProcessor
+
+
+ true
+ true
+
+ true
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.8
+
+ *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search
+
+
+ /**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+ ]]>
+
+
+
+
+
+
diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/HDInsightJobClient.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/HDInsightJobClient.java
new file mode 100644
index 000000000000..dbe351584b34
--- /dev/null
+++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/HDInsightJobClient.java
@@ -0,0 +1,119 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.hdinsight.job;
+
+import com.microsoft.azure.AzureClient;
+import com.microsoft.rest.RestClient;
+
+/**
+ * The interface for HDInsightJobClient class.
+ */
+public interface HDInsightJobClient {
+ /**
+ * Gets the REST client.
+ *
+ * @return the {@link RestClient} object.
+ */
+ RestClient restClient();
+
+ /**
+ * Gets the {@link AzureClient} used for long running operations.
+ * @return the azure client;
+ */
+ AzureClient getAzureClient();
+
+ /**
+ * Gets the User-Agent header for the client.
+ *
+ * @return the user agent string.
+ */
+ String userAgent();
+
+ /**
+ * Gets The cluster endpoint, for example https://clustername.azurehdinsight.net..
+ *
+ * @return the endpoint value.
+ */
+ String endpoint();
+
+ /**
+ * Sets The cluster endpoint, for example https://clustername.azurehdinsight.net..
+ *
+ * @param endpoint the endpoint value.
+ * @return the service client itself
+ */
+ HDInsightJobClient withEndpoint(String endpoint);
+
+ /**
+ * Gets The user name used for running job..
+ *
+ * @return the username value.
+ */
+ String username();
+
+ /**
+ * Sets The user name used for running job..
+ *
+ * @param username the username value.
+ * @return the service client itself
+ */
+ HDInsightJobClient withUsername(String username);
+
+ /**
+ * Gets The preferred language for the response..
+ *
+ * @return the acceptLanguage value.
+ */
+ String acceptLanguage();
+
+ /**
+ * Sets The preferred language for the response..
+ *
+ * @param acceptLanguage the acceptLanguage value.
+ * @return the service client itself
+ */
+ HDInsightJobClient withAcceptLanguage(String acceptLanguage);
+
+ /**
+ * Gets The retry timeout in seconds for Long Running Operations. Default value is 30..
+ *
+ * @return the longRunningOperationRetryTimeout value.
+ */
+ int longRunningOperationRetryTimeout();
+
+ /**
+ * Sets The retry timeout in seconds for Long Running Operations. Default value is 30..
+ *
+ * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
+ * @return the service client itself
+ */
+ HDInsightJobClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout);
+
+ /**
+ * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true..
+ *
+ * @return the generateClientRequestId value.
+ */
+ boolean generateClientRequestId();
+
+ /**
+ * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true..
+ *
+ * @param generateClientRequestId the generateClientRequestId value.
+ * @return the service client itself
+ */
+ HDInsightJobClient withGenerateClientRequestId(boolean generateClientRequestId);
+
+ /**
+ * Gets the Jobs object to access its operations.
+ * @return the Jobs object.
+ */
+ Jobs jobs();
+
+}
diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/Jobs.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/Jobs.java
new file mode 100644
index 000000000000..5fac4318ee60
--- /dev/null
+++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/Jobs.java
@@ -0,0 +1,1546 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.hdinsight.job;
+
+import com.microsoft.azure.CloudException;
+import com.microsoft.azure.hdinsight.job.models.AppState;
+import com.microsoft.azure.hdinsight.job.models.JobDetailRootJsonObject;
+import com.microsoft.azure.hdinsight.job.models.JobListJsonObject;
+import com.microsoft.azure.hdinsight.job.models.JobOperationsErrorResponseException;
+import com.microsoft.azure.hdinsight.job.models.JobSubmissionJsonResponse;
+import com.microsoft.azure.hdinsight.job.models.SparkBatchJob;
+import com.microsoft.azure.hdinsight.job.models.SparkBatchJobCollection;
+import com.microsoft.azure.hdinsight.job.models.SparkBatchJobRequest;
+import com.microsoft.azure.hdinsight.job.models.SparkJobDeletedResult;
+import com.microsoft.azure.hdinsight.job.models.SparkJobLog;
+import com.microsoft.azure.hdinsight.job.models.SparkJobState;
+import com.microsoft.azure.hdinsight.job.models.SparkSessionCollection;
+import com.microsoft.azure.hdinsight.job.models.SparkSessionJob;
+import com.microsoft.azure.hdinsight.job.models.SparkSessionJobRequest;
+import com.microsoft.azure.hdinsight.job.models.SparkStatement;
+import com.microsoft.azure.hdinsight.job.models.SparkStatementCancellationResult;
+import com.microsoft.azure.hdinsight.job.models.SparkStatementCollection;
+import com.microsoft.azure.hdinsight.job.models.SparkStatementRequest;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in Jobs.
+ */
+public interface Jobs {
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobDetailRootJsonObject object if successful.
+ */
+ JobDetailRootJsonObject get(String jobId);
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getAsync(String jobId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ Observable getAsync(String jobId);
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ Observable> getWithServiceResponseAsync(String jobId);
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobDetailRootJsonObject object if successful.
+ */
+ JobDetailRootJsonObject kill(String jobId);
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture killAsync(String jobId, final ServiceCallback serviceCallback);
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ Observable killAsync(String jobId);
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ Observable> killWithServiceResponseAsync(String jobId);
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<JobListJsonObject> object if successful.
+ */
+ List list();
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture> listAsync(final ServiceCallback> serviceCallback);
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ Observable> listAsync();
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ Observable>> listWithServiceResponseAsync();
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<JobListJsonObject> object if successful.
+ */
+ List listAfterJobId();
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture> listAfterJobIdAsync(final ServiceCallback> serviceCallback);
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ Observable> listAfterJobIdAsync();
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ Observable>> listAfterJobIdWithServiceResponseAsync();
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<JobListJsonObject> object if successful.
+ */
+ List listAfterJobId(String jobid, Integer numrecords);
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture> listAfterJobIdAsync(String jobid, Integer numrecords, final ServiceCallback> serviceCallback);
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ Observable> listAfterJobIdAsync(String jobid, Integer numrecords);
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ Observable>> listAfterJobIdWithServiceResponseAsync(String jobid, Integer numrecords);
+
+ /**
+ * Submits a Hive job to an HDInsight cluster.
+ *
+ * @param content The content of the Hive job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobSubmissionJsonResponse object if successful.
+ */
+ JobSubmissionJsonResponse submitHiveJob(byte[] content);
+
+ /**
+ * Submits a Hive job to an HDInsight cluster.
+ *
+ * @param content The content of the Hive job request.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitHiveJobAsync(byte[] content, final ServiceCallback serviceCallback);
+
+ /**
+ * Submits a Hive job to an HDInsight cluster.
+ *
+ * @param content The content of the Hive job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable submitHiveJobAsync(byte[] content);
+
+ /**
+ * Submits a Hive job to an HDInsight cluster.
+ *
+ * @param content The content of the Hive job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable> submitHiveJobWithServiceResponseAsync(byte[] content);
+
+ /**
+ * Submits a MapReduce job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobSubmissionJsonResponse object if successful.
+ */
+ JobSubmissionJsonResponse submitMapReduceJob(byte[] content);
+
+ /**
+ * Submits a MapReduce job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitMapReduceJobAsync(byte[] content, final ServiceCallback serviceCallback);
+
+ /**
+ * Submits a MapReduce job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable submitMapReduceJobAsync(byte[] content);
+
+ /**
+ * Submits a MapReduce job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable> submitMapReduceJobWithServiceResponseAsync(byte[] content);
+
+ /**
+ * Submits a MapReduce streaming job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobSubmissionJsonResponse object if successful.
+ */
+ JobSubmissionJsonResponse submitMapReduceStreamingJob(byte[] content);
+
+ /**
+ * Submits a MapReduce streaming job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitMapReduceStreamingJobAsync(byte[] content, final ServiceCallback serviceCallback);
+
+ /**
+ * Submits a MapReduce streaming job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable submitMapReduceStreamingJobAsync(byte[] content);
+
+ /**
+ * Submits a MapReduce streaming job to an HDInsight cluster.
+ *
+ * @param content The content of the MapReduce job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable> submitMapReduceStreamingJobWithServiceResponseAsync(byte[] content);
+
+ /**
+ * Submits a Pig job to an HDInsight cluster.
+ *
+ * @param content The content of the Pig job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobSubmissionJsonResponse object if successful.
+ */
+ JobSubmissionJsonResponse submitPigJob(byte[] content);
+
+ /**
+ * Submits a Pig job to an HDInsight cluster.
+ *
+ * @param content The content of the Pig job request.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitPigJobAsync(byte[] content, final ServiceCallback serviceCallback);
+
+ /**
+ * Submits a Pig job to an HDInsight cluster.
+ *
+ * @param content The content of the Pig job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable submitPigJobAsync(byte[] content);
+
+ /**
+ * Submits a Pig job to an HDInsight cluster.
+ *
+ * @param content The content of the Pig job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable> submitPigJobWithServiceResponseAsync(byte[] content);
+
+ /**
+ * Submits a Sqoop job to an HDInsight cluster.
+ *
+ * @param content The content of the Sqoop job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobSubmissionJsonResponse object if successful.
+ */
+ JobSubmissionJsonResponse submitSqoopJob(byte[] content);
+
+ /**
+ * Submits a Sqoop job to an HDInsight cluster.
+ *
+ * @param content The content of the Sqoop job request.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSqoopJobAsync(byte[] content, final ServiceCallback serviceCallback);
+
+ /**
+ * Submits a Sqoop job to an HDInsight cluster.
+ *
+ * @param content The content of the Sqoop job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable submitSqoopJobAsync(byte[] content);
+
+ /**
+ * Submits a Sqoop job to an HDInsight cluster.
+ *
+ * @param content The content of the Sqoop job request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobSubmissionJsonResponse object
+ */
+ Observable> submitSqoopJobWithServiceResponseAsync(byte[] content);
+
+ /**
+ * Gets application state from the specified HDInsight cluster.
+ *
+ * @param appId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the AppState object if successful.
+ */
+ AppState getAppState(String appId);
+
+ /**
+ * Gets application state from the specified HDInsight cluster.
+ *
+ * @param appId The id of the job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getAppStateAsync(String appId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets application state from the specified HDInsight cluster.
+ *
+ * @param appId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the AppState object
+ */
+ Observable getAppStateAsync(String appId);
+
+ /**
+ * Gets application state from the specified HDInsight cluster.
+ *
+ * @param appId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the AppState object
+ */
+ Observable> getAppStateWithServiceResponseAsync(String appId);
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkBatchJobCollection object if successful.
+ */
+ SparkBatchJobCollection listSparkBatchJob();
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture listSparkBatchJobAsync(final ServiceCallback serviceCallback);
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJobCollection object
+ */
+ Observable listSparkBatchJobAsync();
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJobCollection object
+ */
+ Observable> listSparkBatchJobWithServiceResponseAsync();
+ /**
+ * List all spark batch jobs.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkBatchJobCollection object if successful.
+ */
+ SparkBatchJobCollection listSparkBatchJob(Integer from, Integer size);
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture listSparkBatchJobAsync(Integer from, Integer size, final ServiceCallback serviceCallback);
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJobCollection object
+ */
+ Observable listSparkBatchJobAsync(Integer from, Integer size);
+
+ /**
+ * List all spark batch jobs.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJobCollection object
+ */
+ Observable> listSparkBatchJobWithServiceResponseAsync(Integer from, Integer size);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkBatchJob object if successful.
+ */
+ SparkBatchJob submitSparkBatchJob(SparkBatchJobRequest sparkBatchJobRequest);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, final ServiceCallback serviceCallback);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJob object
+ */
+ Observable submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJob object
+ */
+ Observable> submitSparkBatchJobWithServiceResponseAsync(SparkBatchJobRequest sparkBatchJobRequest);
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkBatchJob object if successful.
+ */
+ SparkBatchJob submitSparkBatchJob(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy, final ServiceCallback serviceCallback);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJob object
+ */
+ Observable submitSparkBatchJobAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy);
+
+ /**
+ * Create a new spark batch job.
+ *
+ * @param sparkBatchJobRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJob object
+ */
+ Observable> submitSparkBatchJobWithServiceResponseAsync(SparkBatchJobRequest sparkBatchJobRequest, String requestedBy);
+
+ /**
+ * Gets a single spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkBatchJob object if successful.
+ */
+ SparkBatchJob getSparkBatchJob(int batchId);
+
+ /**
+ * Gets a single spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkBatchJobAsync(int batchId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJob object
+ */
+ Observable getSparkBatchJobAsync(int batchId);
+
+ /**
+ * Gets a single spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkBatchJob object
+ */
+ Observable> getSparkBatchJobWithServiceResponseAsync(int batchId);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobDeletedResult object if successful.
+ */
+ SparkJobDeletedResult deleteSparkBatch(int batchId);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture deleteSparkBatchAsync(int batchId, final ServiceCallback serviceCallback);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable deleteSparkBatchAsync(int batchId);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable> deleteSparkBatchWithServiceResponseAsync(int batchId);
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobDeletedResult object if successful.
+ */
+ SparkJobDeletedResult deleteSparkBatch(int batchId, String requestedBy);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture deleteSparkBatchAsync(int batchId, String requestedBy, final ServiceCallback serviceCallback);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable deleteSparkBatchAsync(int batchId, String requestedBy);
+
+ /**
+ * Cancels a running spark batch job.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable> deleteSparkBatchWithServiceResponseAsync(int batchId, String requestedBy);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobLog object if successful.
+ */
+ SparkJobLog getSparkBatchLog(int batchId);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkBatchLogAsync(int batchId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable getSparkBatchLogAsync(int batchId);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable> getSparkBatchLogWithServiceResponseAsync(int batchId);
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobLog object if successful.
+ */
+ SparkJobLog getSparkBatchLog(int batchId, Integer from, Integer size);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkBatchLogAsync(int batchId, Integer from, Integer size, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable getSparkBatchLogAsync(int batchId, Integer from, Integer size);
+
+ /**
+ * Gets a single spark batch job logs.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable> getSparkBatchLogWithServiceResponseAsync(int batchId, Integer from, Integer size);
+
+ /**
+ * Gets a single spark batch state.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobState object if successful.
+ */
+ SparkJobState getSparkBatchState(int batchId);
+
+ /**
+ * Gets a single spark batch state.
+ *
+ * @param batchId Identifier for the batch job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkBatchStateAsync(int batchId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark batch state.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobState object
+ */
+ Observable getSparkBatchStateAsync(int batchId);
+
+ /**
+ * Gets a single spark batch state.
+ *
+ * @param batchId Identifier for the batch job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobState object
+ */
+ Observable> getSparkBatchStateWithServiceResponseAsync(int batchId);
+
+ /**
+ * List all spark sessions.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkSessionCollection object if successful.
+ */
+ SparkSessionCollection listSparkSessionJob();
+
+ /**
+ * List all spark sessions.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture listSparkSessionJobAsync(final ServiceCallback serviceCallback);
+
+ /**
+ * List all spark sessions.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionCollection object
+ */
+ Observable listSparkSessionJobAsync();
+
+ /**
+ * List all spark sessions.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionCollection object
+ */
+ Observable> listSparkSessionJobWithServiceResponseAsync();
+ /**
+ * List all spark sessions.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkSessionCollection object if successful.
+ */
+ SparkSessionCollection listSparkSessionJob(Integer from, Integer size);
+
+ /**
+ * List all spark sessions.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture listSparkSessionJobAsync(Integer from, Integer size, final ServiceCallback serviceCallback);
+
+ /**
+ * List all spark sessions.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionCollection object
+ */
+ Observable listSparkSessionJobAsync(Integer from, Integer size);
+
+ /**
+ * List all spark sessions.
+ *
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionCollection object
+ */
+ Observable> listSparkSessionJobWithServiceResponseAsync(Integer from, Integer size);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkSessionJob object if successful.
+ */
+ SparkSessionJob submitSparkSessionJob(SparkSessionJobRequest sparkSessionJobRequest);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, final ServiceCallback serviceCallback);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionJob object
+ */
+ Observable submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionJob object
+ */
+ Observable> submitSparkSessionJobWithServiceResponseAsync(SparkSessionJobRequest sparkSessionJobRequest);
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkSessionJob object if successful.
+ */
+ SparkSessionJob submitSparkSessionJob(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy, final ServiceCallback serviceCallback);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionJob object
+ */
+ Observable submitSparkSessionJobAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy);
+
+ /**
+ * Create a new spark session.
+ *
+ * @param sparkSessionJobRequest Livy compatible session job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionJob object
+ */
+ Observable> submitSparkSessionJobWithServiceResponseAsync(SparkSessionJobRequest sparkSessionJobRequest, String requestedBy);
+
+ /**
+ * Gets a single spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkSessionJob object if successful.
+ */
+ SparkSessionJob getSparkSessionJob(int sessionId);
+
+ /**
+ * Gets a single spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkSessionJobAsync(int sessionId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionJob object
+ */
+ Observable getSparkSessionJobAsync(int sessionId);
+
+ /**
+ * Gets a single spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkSessionJob object
+ */
+ Observable> getSparkSessionJobWithServiceResponseAsync(int sessionId);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobDeletedResult object if successful.
+ */
+ SparkJobDeletedResult deleteSparkSessionJob(int sessionId);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture deleteSparkSessionJobAsync(int sessionId, final ServiceCallback serviceCallback);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable deleteSparkSessionJobAsync(int sessionId);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable> deleteSparkSessionJobWithServiceResponseAsync(int sessionId);
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobDeletedResult object if successful.
+ */
+ SparkJobDeletedResult deleteSparkSessionJob(int sessionId, String requestedBy);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture deleteSparkSessionJobAsync(int sessionId, String requestedBy, final ServiceCallback serviceCallback);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable deleteSparkSessionJobAsync(int sessionId, String requestedBy);
+
+ /**
+ * Cancels a running spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobDeletedResult object
+ */
+ Observable> deleteSparkSessionJobWithServiceResponseAsync(int sessionId, String requestedBy);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobLog object if successful.
+ */
+ SparkJobLog getSparkSessionLog(int sessionId);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkSessionLogAsync(int sessionId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable getSparkSessionLogAsync(int sessionId);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable> getSparkSessionLogWithServiceResponseAsync(int sessionId);
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobLog object if successful.
+ */
+ SparkJobLog getSparkSessionLog(int sessionId, Integer from, Integer size);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkSessionLogAsync(int sessionId, Integer from, Integer size, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable getSparkSessionLogAsync(int sessionId, Integer from, Integer size);
+
+ /**
+ * Gets a single spark session job logs.
+ *
+ * @param sessionId Identifier for the session job.
+ * @param from Optional param specifying which index the list should begin from.
+ * @param size Optional param specifying the size of the returned list.
+ By default it is 20 and that is the maximum.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobLog object
+ */
+ Observable> getSparkSessionLogWithServiceResponseAsync(int sessionId, Integer from, Integer size);
+
+ /**
+ * Gets a single spark session job state.
+ *
+ * @param sessionId Identifier for the session job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkJobState object if successful.
+ */
+ SparkJobState getSparkSessionState(int sessionId);
+
+ /**
+ * Gets a single spark session job state.
+ *
+ * @param sessionId Identifier for the session job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkSessionStateAsync(int sessionId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single spark session job state.
+ *
+ * @param sessionId Identifier for the session job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobState object
+ */
+ Observable getSparkSessionStateAsync(int sessionId);
+
+ /**
+ * Gets a single spark session job state.
+ *
+ * @param sessionId Identifier for the session job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkJobState object
+ */
+ Observable> getSparkSessionStateWithServiceResponseAsync(int sessionId);
+
+ /**
+ * Gets a list of statements within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkStatementCollection object if successful.
+ */
+ SparkStatementCollection listSparkStatementJob(int sessionId);
+
+ /**
+ * Gets a list of statements within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture listSparkStatementJobAsync(int sessionId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a list of statements within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatementCollection object
+ */
+ Observable listSparkStatementJobAsync(int sessionId);
+
+ /**
+ * Gets a list of statements within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatementCollection object
+ */
+ Observable> listSparkStatementJobWithServiceResponseAsync(int sessionId);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkStatement object if successful.
+ */
+ SparkStatement submitSparkStatementJob(int sessionId, SparkStatementRequest sparkStatementRequest);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, final ServiceCallback serviceCallback);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatement object
+ */
+ Observable submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatement object
+ */
+ Observable> submitSparkStatementJobWithServiceResponseAsync(int sessionId, SparkStatementRequest sparkStatementRequest);
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkStatement object if successful.
+ */
+ SparkStatement submitSparkStatementJob(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy, final ServiceCallback serviceCallback);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatement object
+ */
+ Observable submitSparkStatementJobAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy);
+
+ /**
+ * Create a statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param sparkStatementRequest Livy compatible batch job request payload.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatement object
+ */
+ Observable> submitSparkStatementJobWithServiceResponseAsync(int sessionId, SparkStatementRequest sparkStatementRequest, String requestedBy);
+
+ /**
+ * Gets a single statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkStatement object if successful.
+ */
+ SparkStatement getSparkStatementJob(int sessionId, int statementId);
+
+ /**
+ * Gets a single statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture getSparkStatementJobAsync(int sessionId, int statementId, final ServiceCallback serviceCallback);
+
+ /**
+ * Gets a single statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatement object
+ */
+ Observable getSparkStatementJobAsync(int sessionId, int statementId);
+
+ /**
+ * Gets a single statement within a spark session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatement object
+ */
+ Observable> getSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkStatementCancellationResult object if successful.
+ */
+ SparkStatementCancellationResult deleteSparkStatementJob(int sessionId, int statementId);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture deleteSparkStatementJobAsync(int sessionId, int statementId, final ServiceCallback serviceCallback);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatementCancellationResult object
+ */
+ Observable deleteSparkStatementJobAsync(int sessionId, int statementId);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatementCancellationResult object
+ */
+ Observable> deleteSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId);
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the SparkStatementCancellationResult object if successful.
+ */
+ SparkStatementCancellationResult deleteSparkStatementJob(int sessionId, int statementId, String requestedBy);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ ServiceFuture deleteSparkStatementJobAsync(int sessionId, int statementId, String requestedBy, final ServiceCallback serviceCallback);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatementCancellationResult object
+ */
+ Observable deleteSparkStatementJobAsync(int sessionId, int statementId, String requestedBy);
+
+ /**
+ * Kill a statement within a session.
+ *
+ * @param sessionId Identifier for the session.
+ * @param statementId Identifier for the statement.
+ * @param requestedBy Add default value for X-Requested-By in header.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the SparkStatementCancellationResult object
+ */
+ Observable> deleteSparkStatementJobWithServiceResponseAsync(int sessionId, int statementId, String requestedBy);
+
+}
diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/HDInsightJobClientImpl.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/HDInsightJobClientImpl.java
new file mode 100644
index 000000000000..f4edcad83a08
--- /dev/null
+++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/HDInsightJobClientImpl.java
@@ -0,0 +1,208 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.hdinsight.job.implementation;
+
+import com.microsoft.azure.AzureClient;
+import com.microsoft.azure.AzureServiceClient;
+import com.microsoft.azure.hdinsight.job.HDInsightJobClient;
+import com.microsoft.azure.hdinsight.job.Jobs;
+import com.microsoft.rest.credentials.ServiceClientCredentials;
+import com.microsoft.rest.RestClient;
+
+/**
+ * Initializes a new instance of the HDInsightJobClientImpl class.
+ */
+public class HDInsightJobClientImpl extends AzureServiceClient implements HDInsightJobClient {
+ /** the {@link AzureClient} used for long running operations. */
+ private AzureClient azureClient;
+
+ /**
+ * Gets the {@link AzureClient} used for long running operations.
+ * @return the azure client;
+ */
+ public AzureClient getAzureClient() {
+ return this.azureClient;
+ }
+
+ /** The cluster endpoint, for example https://clustername.azurehdinsight.net. */
+ private String endpoint;
+
+ /**
+ * Gets The cluster endpoint, for example https://clustername.azurehdinsight.net.
+ *
+ * @return the endpoint value.
+ */
+ public String endpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Sets The cluster endpoint, for example https://clustername.azurehdinsight.net.
+ *
+ * @param endpoint the endpoint value.
+ * @return the service client itself
+ */
+ public HDInsightJobClientImpl withEndpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /** The user name used for running job. */
+ private String username;
+
+ /**
+ * Gets The user name used for running job.
+ *
+ * @return the username value.
+ */
+ public String username() {
+ return this.username;
+ }
+
+ /**
+ * Sets The user name used for running job.
+ *
+ * @param username the username value.
+ * @return the service client itself
+ */
+ public HDInsightJobClientImpl withUsername(String username) {
+ this.username = username;
+ return this;
+ }
+
+ /** The preferred language for the response. */
+ private String acceptLanguage;
+
+ /**
+ * Gets The preferred language for the response.
+ *
+ * @return the acceptLanguage value.
+ */
+ public String acceptLanguage() {
+ return this.acceptLanguage;
+ }
+
+ /**
+ * Sets The preferred language for the response.
+ *
+ * @param acceptLanguage the acceptLanguage value.
+ * @return the service client itself
+ */
+ public HDInsightJobClientImpl withAcceptLanguage(String acceptLanguage) {
+ this.acceptLanguage = acceptLanguage;
+ return this;
+ }
+
+ /** The retry timeout in seconds for Long Running Operations. Default value is 30. */
+ private int longRunningOperationRetryTimeout;
+
+ /**
+ * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @return the longRunningOperationRetryTimeout value.
+ */
+ public int longRunningOperationRetryTimeout() {
+ return this.longRunningOperationRetryTimeout;
+ }
+
+ /**
+ * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
+ * @return the service client itself
+ */
+ public HDInsightJobClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
+ this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
+ return this;
+ }
+
+ /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
+ private boolean generateClientRequestId;
+
+ /**
+ * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @return the generateClientRequestId value.
+ */
+ public boolean generateClientRequestId() {
+ return this.generateClientRequestId;
+ }
+
+ /**
+ * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @param generateClientRequestId the generateClientRequestId value.
+ * @return the service client itself
+ */
+ public HDInsightJobClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
+ this.generateClientRequestId = generateClientRequestId;
+ return this;
+ }
+
+ /**
+ * The Jobs object to access its operations.
+ */
+ private Jobs jobs;
+
+ /**
+ * Gets the Jobs object to access its operations.
+ * @return the Jobs object.
+ */
+ public Jobs jobs() {
+ return this.jobs;
+ }
+
+ /**
+ * Initializes an instance of HDInsightJobClient client.
+ *
+ * @param credentials the management credentials for Azure
+ */
+ public HDInsightJobClientImpl(ServiceClientCredentials credentials) {
+ this("https://{endpoint}", credentials);
+ }
+
+ /**
+ * Initializes an instance of HDInsightJobClient client.
+ *
+ * @param baseUrl the base URL of the host
+ * @param credentials the management credentials for Azure
+ */
+ private HDInsightJobClientImpl(String baseUrl, ServiceClientCredentials credentials) {
+ super(baseUrl, credentials);
+ initialize();
+ }
+
+ /**
+ * Initializes an instance of HDInsightJobClient client.
+ *
+ * @param restClient the REST client to connect to Azure.
+ */
+ public HDInsightJobClientImpl(RestClient restClient) {
+ super(restClient);
+ initialize();
+ }
+
+ protected void initialize() {
+ this.acceptLanguage = "en-US";
+ this.longRunningOperationRetryTimeout = 30;
+ this.generateClientRequestId = true;
+ this.jobs = new JobsImpl(restClient().retrofit(), this);
+ this.azureClient = new AzureClient(this);
+ }
+
+ /**
+ * Gets the User-Agent header for the client.
+ *
+ * @return the user agent string.
+ */
+ @Override
+ public String userAgent() {
+ return String.format("%s (%s, %s)", super.userAgent(), "HDInsightJobClient", "2018-11-01-preview");
+ }
+}
diff --git a/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/JobsImpl.java b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/JobsImpl.java
new file mode 100644
index 000000000000..c7475fadecc2
--- /dev/null
+++ b/azure-hdinsight-job/src/main/java/com/microsoft/azure/hdinsight/job/implementation/JobsImpl.java
@@ -0,0 +1,3027 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.hdinsight.job.implementation;
+
+import retrofit2.Retrofit;
+import com.microsoft.azure.hdinsight.job.Jobs;
+import com.google.common.base.Joiner;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.CloudException;
+import com.microsoft.azure.hdinsight.job.models.AppState;
+import com.microsoft.azure.hdinsight.job.models.JobDetailRootJsonObject;
+import com.microsoft.azure.hdinsight.job.models.JobListJsonObject;
+import com.microsoft.azure.hdinsight.job.models.JobOperationsErrorResponseException;
+import com.microsoft.azure.hdinsight.job.models.JobSubmissionJsonResponse;
+import com.microsoft.azure.hdinsight.job.models.SparkBatchJob;
+import com.microsoft.azure.hdinsight.job.models.SparkBatchJobCollection;
+import com.microsoft.azure.hdinsight.job.models.SparkBatchJobRequest;
+import com.microsoft.azure.hdinsight.job.models.SparkJobDeletedResult;
+import com.microsoft.azure.hdinsight.job.models.SparkJobLog;
+import com.microsoft.azure.hdinsight.job.models.SparkJobState;
+import com.microsoft.azure.hdinsight.job.models.SparkSessionCollection;
+import com.microsoft.azure.hdinsight.job.models.SparkSessionJob;
+import com.microsoft.azure.hdinsight.job.models.SparkSessionJobRequest;
+import com.microsoft.azure.hdinsight.job.models.SparkStatement;
+import com.microsoft.azure.hdinsight.job.models.SparkStatementCancellationResult;
+import com.microsoft.azure.hdinsight.job.models.SparkStatementCollection;
+import com.microsoft.azure.hdinsight.job.models.SparkStatementRequest;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.Validator;
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.MediaType;
+import okhttp3.RequestBody;
+import okhttp3.ResponseBody;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.HTTP;
+import retrofit2.http.Path;
+import retrofit2.http.POST;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in Jobs.
+ */
+public class JobsImpl implements Jobs {
+ /** The Retrofit service to perform REST calls. */
+ private JobsService service;
+ /** The service client containing this operation class. */
+ private HDInsightJobClientImpl client;
+
+ /**
+ * Initializes an instance of JobsImpl.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public JobsImpl(Retrofit retrofit, HDInsightJobClientImpl client) {
+ this.service = retrofit.create(JobsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for Jobs to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface JobsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs get" })
+ @GET("templeton/v1/jobs/{jobId}")
+ Observable> get(@Path("jobId") String jobId, @Query("user.name") String username, @Query("fields") String fields, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs kill" })
+ @HTTP(path = "templeton/v1/jobs/{jobId}", method = "DELETE", hasBody = true)
+ Observable> kill(@Path("jobId") String jobId, @Query("user.name") String username, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs list" })
+ @GET("templeton/v1/jobs")
+ Observable> list(@Query("user.name") String username, @Query("showall") String showall, @Query("fields") String fields, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listAfterJobId" })
+ @GET("templeton/v1/jobs")
+ Observable> listAfterJobId(@Query("user.name") String username, @Query("jobid") String jobid, @Query("numrecords") Integer numrecords, @Query("showall") String showall, @Query("fields") String fields, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/text", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitHiveJob" })
+ @POST("templeton/v1/hive")
+ Observable> submitHiveJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitMapReduceJob" })
+ @POST("templeton/v1/mapreduce/jar")
+ Observable> submitMapReduceJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitMapReduceStreamingJob" })
+ @POST("templeton/v1/mapreduce/streaming")
+ Observable> submitMapReduceStreamingJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitPigJob" })
+ @POST("templeton/v1/pig")
+ Observable> submitPigJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: text/plain", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSqoopJob" })
+ @POST("templeton/v1/sqoop")
+ Observable> submitSqoopJob(@Query("user.name") String username, @Body RequestBody content, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getAppState" })
+ @GET("ws/v1/cluster/apps/{appId}/state")
+ Observable> getAppState(@Path("appId") String appId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listSparkBatchJob" })
+ @GET("livy/batches")
+ Observable> listSparkBatchJob(@Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSparkBatchJob" })
+ @POST("livy/batches")
+ Observable> submitSparkBatchJob(@Header("X-Requested-By") String requestedBy, @Body SparkBatchJobRequest sparkBatchJobRequest, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkBatchJob" })
+ @GET("livy/batches/{batchId}")
+ Observable> getSparkBatchJob(@Path("batchId") int batchId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs deleteSparkBatch" })
+ @HTTP(path = "livy/batches/{batchId}", method = "DELETE", hasBody = true)
+ Observable> deleteSparkBatch(@Path("batchId") int batchId, @Header("X-Requested-By") String requestedBy, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkBatchLog" })
+ @GET("livy/batches/{batchId}/log")
+ Observable> getSparkBatchLog(@Path("batchId") int batchId, @Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkBatchState" })
+ @GET("livy/batches/{batchId}/state")
+ Observable> getSparkBatchState(@Path("batchId") int batchId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listSparkSessionJob" })
+ @GET("livy/sessions")
+ Observable> listSparkSessionJob(@Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSparkSessionJob" })
+ @POST("livy/sessions")
+ Observable> submitSparkSessionJob(@Header("X-Requested-By") String requestedBy, @Body SparkSessionJobRequest sparkSessionJobRequest, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkSessionJob" })
+ @GET("livy/sessions/{sessionId}")
+ Observable> getSparkSessionJob(@Path("sessionId") int sessionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs deleteSparkSessionJob" })
+ @HTTP(path = "livy/sessions/{sessionId}", method = "DELETE", hasBody = true)
+ Observable> deleteSparkSessionJob(@Path("sessionId") int sessionId, @Header("X-Requested-By") String requestedBy, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkSessionLog" })
+ @GET("livy/sessions/{sessionId}/log")
+ Observable> getSparkSessionLog(@Path("sessionId") int sessionId, @Query("from") Integer from, @Query("size") Integer size, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkSessionState" })
+ @GET("livy/sessions/{sessionId}/state")
+ Observable> getSparkSessionState(@Path("sessionId") int sessionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs listSparkStatementJob" })
+ @GET("livy/sessions/{sessionId}/statements")
+ Observable> listSparkStatementJob(@Path("sessionId") int sessionId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs submitSparkStatementJob" })
+ @POST("livy/sessions/{sessionId}/statements")
+ Observable> submitSparkStatementJob(@Path("sessionId") int sessionId, @Header("X-Requested-By") String requestedBy, @Body SparkStatementRequest sparkStatementRequest, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs getSparkStatementJob" })
+ @GET("livy/sessions/{sessionId}/statements/{statementId}")
+ Observable> getSparkStatementJob(@Path("sessionId") int sessionId, @Path("statementId") int statementId, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.hdinsight.job.Jobs deleteSparkStatementJob" })
+ @POST("livy/sessions/{sessionId}/statements/{statementId}/cancel")
+ Observable> deleteSparkStatementJob(@Path("sessionId") int sessionId, @Path("statementId") int statementId, @Header("X-Requested-By") String requestedBy, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobDetailRootJsonObject object if successful.
+ */
+ public JobDetailRootJsonObject get(String jobId) {
+ return getWithServiceResponseAsync(jobId).toBlocking().single().body();
+ }
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture getAsync(String jobId, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(getWithServiceResponseAsync(jobId), serviceCallback);
+ }
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ public Observable getAsync(String jobId) {
+ return getWithServiceResponseAsync(jobId).map(new Func1, JobDetailRootJsonObject>() {
+ @Override
+ public JobDetailRootJsonObject call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Gets job details from the specified HDInsight cluster.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ public Observable> getWithServiceResponseAsync(String jobId) {
+ if (this.client.endpoint() == null) {
+ throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
+ }
+ if (jobId == null) {
+ throw new IllegalArgumentException("Parameter jobId is required and cannot be null.");
+ }
+ if (this.client.username() == null) {
+ throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null.");
+ }
+ final String fields = "*";
+ String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint());
+ return service.get(jobId, this.client.username(), fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = getDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse getDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(JobOperationsErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the JobDetailRootJsonObject object if successful.
+ */
+ public JobDetailRootJsonObject kill(String jobId) {
+ return killWithServiceResponseAsync(jobId).toBlocking().single().body();
+ }
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture killAsync(String jobId, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(killWithServiceResponseAsync(jobId), serviceCallback);
+ }
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ public Observable killAsync(String jobId) {
+ return killWithServiceResponseAsync(jobId).map(new Func1, JobDetailRootJsonObject>() {
+ @Override
+ public JobDetailRootJsonObject call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Initiates cancel on given running job in the specified HDInsight.
+ *
+ * @param jobId The id of the job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the JobDetailRootJsonObject object
+ */
+ public Observable> killWithServiceResponseAsync(String jobId) {
+ if (this.client.endpoint() == null) {
+ throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
+ }
+ if (jobId == null) {
+ throw new IllegalArgumentException("Parameter jobId is required and cannot be null.");
+ }
+ if (this.client.username() == null) {
+ throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null.");
+ }
+ String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint());
+ return service.kill(jobId, this.client.username(), this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = killDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse killDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(JobOperationsErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<JobListJsonObject> object if successful.
+ */
+ public List list() {
+ return listWithServiceResponseAsync().toBlocking().single().body();
+ }
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
+ }
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ public Observable> listAsync() {
+ return listWithServiceResponseAsync().map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Gets the list of jobs from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ public Observable>> listWithServiceResponseAsync() {
+ if (this.client.endpoint() == null) {
+ throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
+ }
+ if (this.client.username() == null) {
+ throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null.");
+ }
+ final String showall = "true";
+ final String fields = "*";
+ String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint());
+ return service.list(this.client.username(), showall, fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> clientResponse = listDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse> listDelegate(Response response) throws JobOperationsErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., JobOperationsErrorResponseException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(JobOperationsErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<JobListJsonObject> object if successful.
+ */
+ public List listAfterJobId() {
+ return listAfterJobIdWithServiceResponseAsync().toBlocking().single().body();
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAfterJobIdAsync(final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listAfterJobIdWithServiceResponseAsync(), serviceCallback);
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ public Observable> listAfterJobIdAsync() {
+ return listAfterJobIdWithServiceResponseAsync().map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ public Observable>> listAfterJobIdWithServiceResponseAsync() {
+ if (this.client.endpoint() == null) {
+ throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
+ }
+ if (this.client.username() == null) {
+ throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null.");
+ }
+ final String showall = "true";
+ final String fields = "*";
+ final String jobid = null;
+ final Integer numrecords = null;
+ String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint());
+ return service.listAfterJobId(this.client.username(), jobid, numrecords, showall, fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> clientResponse = listAfterJobIdDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws JobOperationsErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<JobListJsonObject> object if successful.
+ */
+ public List listAfterJobId(String jobid, Integer numrecords) {
+ return listAfterJobIdWithServiceResponseAsync(jobid, numrecords).toBlocking().single().body();
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAfterJobIdAsync(String jobid, Integer numrecords, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listAfterJobIdWithServiceResponseAsync(jobid, numrecords), serviceCallback);
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ public Observable> listAfterJobIdAsync(String jobid, Integer numrecords) {
+ return listAfterJobIdWithServiceResponseAsync(jobid, numrecords).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Gets numrecords Of Jobs after jobid from the specified HDInsight cluster.
+ *
+ * @param jobid JobId from where to list jobs.
+ * @param numrecords Number of jobs to fetch.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<JobListJsonObject> object
+ */
+ public Observable>> listAfterJobIdWithServiceResponseAsync(String jobid, Integer numrecords) {
+ if (this.client.endpoint() == null) {
+ throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
+ }
+ if (this.client.username() == null) {
+ throw new IllegalArgumentException("Parameter this.client.username() is required and cannot be null.");
+ }
+ final String showall = "true";
+ final String fields = "*";
+ String parameterizedHost = Joiner.on(", ").join("{endpoint}", this.client.endpoint());
+ return service.listAfterJobId(this.client.username(), jobid, numrecords, showall, fields, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> clientResponse = listAfterJobIdDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse> listAfterJobIdDelegate(Response