diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/pom.xml b/sdk/scheduler/mgmt-v2014_08_01_preview/pom.xml new file mode 100644 index 000000000000..2e05ba077456 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.scheduler.v2014_08_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-scheduler + 1.0.0-beta + jar + Microsoft Azure SDK for Scheduler Management + This package contains Microsoft Scheduler Management 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 + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + 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/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/BasicAuthentication.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/BasicAuthentication.java new file mode 100644 index 000000000000..348b0e7d4486 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/BasicAuthentication.java @@ -0,0 +1,69 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The BasicAuthentication model. + */ +public class BasicAuthentication extends HttpAuthentication { + /** + * Gets or sets the username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * Gets or sets the password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get gets or sets the username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set gets or sets the username. + * + * @param username the username value to set + * @return the BasicAuthentication object itself. + */ + public BasicAuthentication withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get gets or sets the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set gets or sets the password. + * + * @param password the password value to set + * @return the BasicAuthentication object itself. + */ + public BasicAuthentication withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ClientCertAuthentication.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ClientCertAuthentication.java new file mode 100644 index 000000000000..433deec9dab3 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ClientCertAuthentication.java @@ -0,0 +1,148 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ClientCertAuthentication model. + */ +public class ClientCertAuthentication extends HttpAuthentication { + /** + * Gets or sets the password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Gets or sets the pfx. + */ + @JsonProperty(value = "pfx") + private String pfx; + + /** + * Gets or sets the certificate thumbprint. + */ + @JsonProperty(value = "certificateThumbprint") + private String certificateThumbprint; + + /** + * Gets or sets the certificate expiration date. + */ + @JsonProperty(value = "certificateExpirationDate") + private DateTime certificateExpirationDate; + + /** + * Gets or sets the certificate subject name. + */ + @JsonProperty(value = "certificateSubjectName") + private String certificateSubjectName; + + /** + * Get gets or sets the password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set gets or sets the password. + * + * @param password the password value to set + * @return the ClientCertAuthentication object itself. + */ + public ClientCertAuthentication withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get gets or sets the pfx. + * + * @return the pfx value + */ + public String pfx() { + return this.pfx; + } + + /** + * Set gets or sets the pfx. + * + * @param pfx the pfx value to set + * @return the ClientCertAuthentication object itself. + */ + public ClientCertAuthentication withPfx(String pfx) { + this.pfx = pfx; + return this; + } + + /** + * Get gets or sets the certificate thumbprint. + * + * @return the certificateThumbprint value + */ + public String certificateThumbprint() { + return this.certificateThumbprint; + } + + /** + * Set gets or sets the certificate thumbprint. + * + * @param certificateThumbprint the certificateThumbprint value to set + * @return the ClientCertAuthentication object itself. + */ + public ClientCertAuthentication withCertificateThumbprint(String certificateThumbprint) { + this.certificateThumbprint = certificateThumbprint; + return this; + } + + /** + * Get gets or sets the certificate expiration date. + * + * @return the certificateExpirationDate value + */ + public DateTime certificateExpirationDate() { + return this.certificateExpirationDate; + } + + /** + * Set gets or sets the certificate expiration date. + * + * @param certificateExpirationDate the certificateExpirationDate value to set + * @return the ClientCertAuthentication object itself. + */ + public ClientCertAuthentication withCertificateExpirationDate(DateTime certificateExpirationDate) { + this.certificateExpirationDate = certificateExpirationDate; + return this; + } + + /** + * Get gets or sets the certificate subject name. + * + * @return the certificateSubjectName value + */ + public String certificateSubjectName() { + return this.certificateSubjectName; + } + + /** + * Set gets or sets the certificate subject name. + * + * @param certificateSubjectName the certificateSubjectName value to set + * @return the ClientCertAuthentication object itself. + */ + public ClientCertAuthentication withCertificateSubjectName(String certificateSubjectName) { + this.certificateSubjectName = certificateSubjectName; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/DayOfWeek.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/DayOfWeek.java new file mode 100644 index 000000000000..49a127b0033a --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/DayOfWeek.java @@ -0,0 +1,68 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DayOfWeek. + */ +public enum DayOfWeek { + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"), + + /** Enum value Sunday. */ + SUNDAY("Sunday"); + + /** The actual serialized value for a DayOfWeek instance. */ + private String value; + + DayOfWeek(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DayOfWeek instance. + * + * @param value the serialized value to parse. + * @return the parsed DayOfWeek object, or null if unable to parse. + */ + @JsonCreator + public static DayOfWeek fromString(String value) { + DayOfWeek[] items = DayOfWeek.values(); + for (DayOfWeek item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpAuthentication.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpAuthentication.java new file mode 100644 index 000000000000..daa1575f311f --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpAuthentication.java @@ -0,0 +1,44 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HttpAuthentication model. + */ +public class HttpAuthentication { + /** + * Gets or sets the http authentication type. Possible values include: + * 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'. + */ + @JsonProperty(value = "type") + private HttpAuthenticationType type; + + /** + * Get gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'. + * + * @return the type value + */ + public HttpAuthenticationType type() { + return this.type; + } + + /** + * Set gets or sets the http authentication type. Possible values include: 'NotSpecified', 'ClientCertificate', 'ActiveDirectoryOAuth', 'Basic'. + * + * @param type the type value to set + * @return the HttpAuthentication object itself. + */ + public HttpAuthentication withType(HttpAuthenticationType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpAuthenticationType.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpAuthenticationType.java new file mode 100644 index 000000000000..c50d4f315d7e --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpAuthenticationType.java @@ -0,0 +1,59 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for HttpAuthenticationType. + */ +public enum HttpAuthenticationType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value ClientCertificate. */ + CLIENT_CERTIFICATE("ClientCertificate"), + + /** Enum value ActiveDirectoryOAuth. */ + ACTIVE_DIRECTORY_OAUTH("ActiveDirectoryOAuth"), + + /** Enum value Basic. */ + BASIC("Basic"); + + /** The actual serialized value for a HttpAuthenticationType instance. */ + private String value; + + HttpAuthenticationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a HttpAuthenticationType instance. + * + * @param value the serialized value to parse. + * @return the parsed HttpAuthenticationType object, or null if unable to parse. + */ + @JsonCreator + public static HttpAuthenticationType fromString(String value) { + HttpAuthenticationType[] items = HttpAuthenticationType.values(); + for (HttpAuthenticationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpRequest.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpRequest.java new file mode 100644 index 000000000000..24f9d6c1d684 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/HttpRequest.java @@ -0,0 +1,148 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The HttpRequest model. + */ +public class HttpRequest { + /** + * Gets or sets the http authentication. + */ + @JsonProperty(value = "authentication") + private HttpAuthentication authentication; + + /** + * Gets or sets the Uri. + */ + @JsonProperty(value = "uri") + private String uri; + + /** + * Gets or sets the method of the request. + */ + @JsonProperty(value = "method") + private String method; + + /** + * Gets or sets the request body. + */ + @JsonProperty(value = "body") + private String body; + + /** + * Gets or sets the headers. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * Get gets or sets the http authentication. + * + * @return the authentication value + */ + public HttpAuthentication authentication() { + return this.authentication; + } + + /** + * Set gets or sets the http authentication. + * + * @param authentication the authentication value to set + * @return the HttpRequest object itself. + */ + public HttpRequest withAuthentication(HttpAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get gets or sets the Uri. + * + * @return the uri value + */ + public String uri() { + return this.uri; + } + + /** + * Set gets or sets the Uri. + * + * @param uri the uri value to set + * @return the HttpRequest object itself. + */ + public HttpRequest withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get gets or sets the method of the request. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set gets or sets the method of the request. + * + * @param method the method value to set + * @return the HttpRequest object itself. + */ + public HttpRequest withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get gets or sets the request body. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set gets or sets the request body. + * + * @param body the body value to set + * @return the HttpRequest object itself. + */ + public HttpRequest withBody(String body) { + this.body = body; + return this; + } + + /** + * Get gets or sets the headers. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set gets or sets the headers. + * + * @param headers the headers value to set + * @return the HttpRequest object itself. + */ + public HttpRequest withHeaders(Map headers) { + this.headers = headers; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobAction.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobAction.java new file mode 100644 index 000000000000..076d9f52dd1a --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobAction.java @@ -0,0 +1,200 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobAction model. + */ +public class JobAction { + /** + * Gets or sets the job action type. Possible values include: 'Http', + * 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'. + */ + @JsonProperty(value = "type") + private JobActionType type; + + /** + * Gets or sets the http requests. + */ + @JsonProperty(value = "request") + private HttpRequest request; + + /** + * Gets or sets the storage queue message. + */ + @JsonProperty(value = "queueMessage") + private StorageQueueMessage queueMessage; + + /** + * Gets or sets the service bus queue message. + */ + @JsonProperty(value = "serviceBusQueueMessage") + private ServiceBusQueueMessage serviceBusQueueMessage; + + /** + * Gets or sets the service bus topic message. + */ + @JsonProperty(value = "serviceBusTopicMessage") + private ServiceBusTopicMessage serviceBusTopicMessage; + + /** + * Gets or sets the retry policy. + */ + @JsonProperty(value = "retryPolicy") + private RetryPolicy retryPolicy; + + /** + * Gets or sets the error action. + */ + @JsonProperty(value = "errorAction") + private JobErrorAction errorAction; + + /** + * Get gets or sets the job action type. Possible values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'. + * + * @return the type value + */ + public JobActionType type() { + return this.type; + } + + /** + * Set gets or sets the job action type. Possible values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'. + * + * @param type the type value to set + * @return the JobAction object itself. + */ + public JobAction withType(JobActionType type) { + this.type = type; + return this; + } + + /** + * Get gets or sets the http requests. + * + * @return the request value + */ + public HttpRequest request() { + return this.request; + } + + /** + * Set gets or sets the http requests. + * + * @param request the request value to set + * @return the JobAction object itself. + */ + public JobAction withRequest(HttpRequest request) { + this.request = request; + return this; + } + + /** + * Get gets or sets the storage queue message. + * + * @return the queueMessage value + */ + public StorageQueueMessage queueMessage() { + return this.queueMessage; + } + + /** + * Set gets or sets the storage queue message. + * + * @param queueMessage the queueMessage value to set + * @return the JobAction object itself. + */ + public JobAction withQueueMessage(StorageQueueMessage queueMessage) { + this.queueMessage = queueMessage; + return this; + } + + /** + * Get gets or sets the service bus queue message. + * + * @return the serviceBusQueueMessage value + */ + public ServiceBusQueueMessage serviceBusQueueMessage() { + return this.serviceBusQueueMessage; + } + + /** + * Set gets or sets the service bus queue message. + * + * @param serviceBusQueueMessage the serviceBusQueueMessage value to set + * @return the JobAction object itself. + */ + public JobAction withServiceBusQueueMessage(ServiceBusQueueMessage serviceBusQueueMessage) { + this.serviceBusQueueMessage = serviceBusQueueMessage; + return this; + } + + /** + * Get gets or sets the service bus topic message. + * + * @return the serviceBusTopicMessage value + */ + public ServiceBusTopicMessage serviceBusTopicMessage() { + return this.serviceBusTopicMessage; + } + + /** + * Set gets or sets the service bus topic message. + * + * @param serviceBusTopicMessage the serviceBusTopicMessage value to set + * @return the JobAction object itself. + */ + public JobAction withServiceBusTopicMessage(ServiceBusTopicMessage serviceBusTopicMessage) { + this.serviceBusTopicMessage = serviceBusTopicMessage; + return this; + } + + /** + * Get gets or sets the retry policy. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set gets or sets the retry policy. + * + * @param retryPolicy the retryPolicy value to set + * @return the JobAction object itself. + */ + public JobAction withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Get gets or sets the error action. + * + * @return the errorAction value + */ + public JobErrorAction errorAction() { + return this.errorAction; + } + + /** + * Set gets or sets the error action. + * + * @param errorAction the errorAction value to set + * @return the JobAction object itself. + */ + public JobAction withErrorAction(JobErrorAction errorAction) { + this.errorAction = errorAction; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobActionType.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobActionType.java new file mode 100644 index 000000000000..e2e95805e337 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobActionType.java @@ -0,0 +1,62 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobActionType. + */ +public enum JobActionType { + /** Enum value Http. */ + HTTP("Http"), + + /** Enum value Https. */ + HTTPS("Https"), + + /** Enum value StorageQueue. */ + STORAGE_QUEUE("StorageQueue"), + + /** Enum value ServiceBusQueue. */ + SERVICE_BUS_QUEUE("ServiceBusQueue"), + + /** Enum value ServiceBusTopic. */ + SERVICE_BUS_TOPIC("ServiceBusTopic"); + + /** The actual serialized value for a JobActionType instance. */ + private String value; + + JobActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed JobActionType object, or null if unable to parse. + */ + @JsonCreator + public static JobActionType fromString(String value) { + JobActionType[] items = JobActionType.values(); + for (JobActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionDefinition.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionDefinition.java new file mode 100644 index 000000000000..5d00b93019dc --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionDefinition.java @@ -0,0 +1,97 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.SchedulerManager; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.JobCollectionDefinitionInner; + +/** + * Type representing JobCollectionDefinition. + */ +public interface JobCollectionDefinition extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the properties value. + */ + JobCollectionProperties properties(); + + /** + * The entirety of the JobCollectionDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of JobCollectionDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a JobCollectionDefinition definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the JobCollectionDefinition definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the jobcollectiondefinition definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets the job collection properties + * @return the next definition stage + */ + WithCreate withProperties(JobCollectionProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProperties { + } + } + /** + * The template for a JobCollectionDefinition update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProperties { + } + + /** + * Grouping of JobCollectionDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the jobcollectiondefinition update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets the job collection properties + * @return the next update stage + */ + Update withProperties(JobCollectionProperties properties); + } + + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionProperties.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionProperties.java new file mode 100644 index 000000000000..6dad1cba7def --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionProperties.java @@ -0,0 +1,96 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobCollectionProperties model. + */ +public class JobCollectionProperties { + /** + * Gets or sets the SKU. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Gets or sets the state. Possible values include: 'Enabled', 'Disabled', + * 'Suspended', 'Deleted'. + */ + @JsonProperty(value = "state") + private JobCollectionState state; + + /** + * Gets or sets the job collection quota. + */ + @JsonProperty(value = "quota") + private JobCollectionQuota quota; + + /** + * Get gets or sets the SKU. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set gets or sets the SKU. + * + * @param sku the sku value to set + * @return the JobCollectionProperties object itself. + */ + public JobCollectionProperties withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get gets or sets the state. Possible values include: 'Enabled', 'Disabled', 'Suspended', 'Deleted'. + * + * @return the state value + */ + public JobCollectionState state() { + return this.state; + } + + /** + * Set gets or sets the state. Possible values include: 'Enabled', 'Disabled', 'Suspended', 'Deleted'. + * + * @param state the state value to set + * @return the JobCollectionProperties object itself. + */ + public JobCollectionProperties withState(JobCollectionState state) { + this.state = state; + return this; + } + + /** + * Get gets or sets the job collection quota. + * + * @return the quota value + */ + public JobCollectionQuota quota() { + return this.quota; + } + + /** + * Set gets or sets the job collection quota. + * + * @param quota the quota value to set + * @return the JobCollectionProperties object itself. + */ + public JobCollectionProperties withQuota(JobCollectionQuota quota) { + this.quota = quota; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionQuota.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionQuota.java new file mode 100644 index 000000000000..1e8e334716ff --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionQuota.java @@ -0,0 +1,95 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobCollectionQuota model. + */ +public class JobCollectionQuota { + /** + * Gets or set the maximum job count. + */ + @JsonProperty(value = "maxJobCount") + private Integer maxJobCount; + + /** + * Gets or sets the maximum job occurrence. + */ + @JsonProperty(value = "maxJobOccurrence") + private Integer maxJobOccurrence; + + /** + * Gets or set the maximum recurrence. + */ + @JsonProperty(value = "maxRecurrence") + private JobMaxRecurrence maxRecurrence; + + /** + * Get gets or set the maximum job count. + * + * @return the maxJobCount value + */ + public Integer maxJobCount() { + return this.maxJobCount; + } + + /** + * Set gets or set the maximum job count. + * + * @param maxJobCount the maxJobCount value to set + * @return the JobCollectionQuota object itself. + */ + public JobCollectionQuota withMaxJobCount(Integer maxJobCount) { + this.maxJobCount = maxJobCount; + return this; + } + + /** + * Get gets or sets the maximum job occurrence. + * + * @return the maxJobOccurrence value + */ + public Integer maxJobOccurrence() { + return this.maxJobOccurrence; + } + + /** + * Set gets or sets the maximum job occurrence. + * + * @param maxJobOccurrence the maxJobOccurrence value to set + * @return the JobCollectionQuota object itself. + */ + public JobCollectionQuota withMaxJobOccurrence(Integer maxJobOccurrence) { + this.maxJobOccurrence = maxJobOccurrence; + return this; + } + + /** + * Get gets or set the maximum recurrence. + * + * @return the maxRecurrence value + */ + public JobMaxRecurrence maxRecurrence() { + return this.maxRecurrence; + } + + /** + * Set gets or set the maximum recurrence. + * + * @param maxRecurrence the maxRecurrence value to set + * @return the JobCollectionQuota object itself. + */ + public JobCollectionQuota withMaxRecurrence(JobMaxRecurrence maxRecurrence) { + this.maxRecurrence = maxRecurrence; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionState.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionState.java new file mode 100644 index 000000000000..8e2e66b7c20b --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollectionState.java @@ -0,0 +1,59 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobCollectionState. + */ +public enum JobCollectionState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Suspended. */ + SUSPENDED("Suspended"), + + /** Enum value Deleted. */ + DELETED("Deleted"); + + /** The actual serialized value for a JobCollectionState instance. */ + private String value; + + JobCollectionState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobCollectionState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobCollectionState object, or null if unable to parse. + */ + @JsonCreator + public static JobCollectionState fromString(String value) { + JobCollectionState[] items = JobCollectionState.values(); + for (JobCollectionState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollections.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollections.java new file mode 100644 index 000000000000..153751459ec9 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobCollections.java @@ -0,0 +1,46 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.JobCollectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing JobCollections. + */ +public interface JobCollections extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Enables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableAsync(String resourceGroupName, String jobCollectionName); + + /** + * Disables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableAsync(String resourceGroupName, String jobCollectionName); + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobDefinition.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobDefinition.java new file mode 100644 index 000000000000..5bcf1329836d --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobDefinition.java @@ -0,0 +1,118 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.JobDefinitionInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.SchedulerManager; +import org.joda.time.DateTime; + +/** + * Type representing JobDefinition. + */ +public interface JobDefinition extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + JobProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the JobDefinition definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithJobCollection, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of JobDefinition definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a JobDefinition definition. + */ + interface Blank extends WithJobCollection { + } + + /** + * The stage of the jobdefinition definition allowing to specify JobCollection. + */ + interface WithJobCollection { + /** + * Specifies resourceGroupName, jobCollectionName. + * @param resourceGroupName The resource group name + * @param jobCollectionName The job collection name + * @return the next definition stage + */ + WithProperties withExistingJobCollection(String resourceGroupName, String jobCollectionName); + } + + /** + * The stage of the jobdefinition definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets the job properties + * @return the next definition stage + */ + WithCreate withProperties(JobProperties properties); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a JobDefinition update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties { + } + + /** + * Grouping of JobDefinition update stages. + */ + interface UpdateStages { + /** + * The stage of the jobdefinition update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties Gets or sets the job properties + * @return the next update stage + */ + Update withProperties(JobProperties properties); + } + + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobErrorAction.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobErrorAction.java new file mode 100644 index 000000000000..05a200ce8944 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobErrorAction.java @@ -0,0 +1,174 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobErrorAction model. + */ +public class JobErrorAction { + /** + * Gets or sets the job error action type. Possible values include: 'Http', + * 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'. + */ + @JsonProperty(value = "type") + private JobActionType type; + + /** + * Gets or sets the http requests. + */ + @JsonProperty(value = "request") + private HttpRequest request; + + /** + * Gets or sets the storage queue message. + */ + @JsonProperty(value = "queueMessage") + private StorageQueueMessage queueMessage; + + /** + * Gets or sets the service bus queue message. + */ + @JsonProperty(value = "serviceBusQueueMessage") + private ServiceBusQueueMessage serviceBusQueueMessage; + + /** + * Gets or sets the service bus topic message. + */ + @JsonProperty(value = "serviceBusTopicMessage") + private ServiceBusTopicMessage serviceBusTopicMessage; + + /** + * Gets or sets the retry policy. + */ + @JsonProperty(value = "retryPolicy") + private RetryPolicy retryPolicy; + + /** + * Get gets or sets the job error action type. Possible values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'. + * + * @return the type value + */ + public JobActionType type() { + return this.type; + } + + /** + * Set gets or sets the job error action type. Possible values include: 'Http', 'Https', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'. + * + * @param type the type value to set + * @return the JobErrorAction object itself. + */ + public JobErrorAction withType(JobActionType type) { + this.type = type; + return this; + } + + /** + * Get gets or sets the http requests. + * + * @return the request value + */ + public HttpRequest request() { + return this.request; + } + + /** + * Set gets or sets the http requests. + * + * @param request the request value to set + * @return the JobErrorAction object itself. + */ + public JobErrorAction withRequest(HttpRequest request) { + this.request = request; + return this; + } + + /** + * Get gets or sets the storage queue message. + * + * @return the queueMessage value + */ + public StorageQueueMessage queueMessage() { + return this.queueMessage; + } + + /** + * Set gets or sets the storage queue message. + * + * @param queueMessage the queueMessage value to set + * @return the JobErrorAction object itself. + */ + public JobErrorAction withQueueMessage(StorageQueueMessage queueMessage) { + this.queueMessage = queueMessage; + return this; + } + + /** + * Get gets or sets the service bus queue message. + * + * @return the serviceBusQueueMessage value + */ + public ServiceBusQueueMessage serviceBusQueueMessage() { + return this.serviceBusQueueMessage; + } + + /** + * Set gets or sets the service bus queue message. + * + * @param serviceBusQueueMessage the serviceBusQueueMessage value to set + * @return the JobErrorAction object itself. + */ + public JobErrorAction withServiceBusQueueMessage(ServiceBusQueueMessage serviceBusQueueMessage) { + this.serviceBusQueueMessage = serviceBusQueueMessage; + return this; + } + + /** + * Get gets or sets the service bus topic message. + * + * @return the serviceBusTopicMessage value + */ + public ServiceBusTopicMessage serviceBusTopicMessage() { + return this.serviceBusTopicMessage; + } + + /** + * Set gets or sets the service bus topic message. + * + * @param serviceBusTopicMessage the serviceBusTopicMessage value to set + * @return the JobErrorAction object itself. + */ + public JobErrorAction withServiceBusTopicMessage(ServiceBusTopicMessage serviceBusTopicMessage) { + this.serviceBusTopicMessage = serviceBusTopicMessage; + return this; + } + + /** + * Get gets or sets the retry policy. + * + * @return the retryPolicy value + */ + public RetryPolicy retryPolicy() { + return this.retryPolicy; + } + + /** + * Set gets or sets the retry policy. + * + * @param retryPolicy the retryPolicy value to set + * @return the JobErrorAction object itself. + */ + public JobErrorAction withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobExecutionStatus.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobExecutionStatus.java new file mode 100644 index 000000000000..4d01b2b942de --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobExecutionStatus.java @@ -0,0 +1,56 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobExecutionStatus. + */ +public enum JobExecutionStatus { + /** Enum value Completed. */ + COMPLETED("Completed"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Postponed. */ + POSTPONED("Postponed"); + + /** The actual serialized value for a JobExecutionStatus instance. */ + private String value; + + JobExecutionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobExecutionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed JobExecutionStatus object, or null if unable to parse. + */ + @JsonCreator + public static JobExecutionStatus fromString(String value) { + JobExecutionStatus[] items = JobExecutionStatus.values(); + for (JobExecutionStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryActionName.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryActionName.java new file mode 100644 index 000000000000..eb8a4e1a5a16 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryActionName.java @@ -0,0 +1,53 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobHistoryActionName. + */ +public enum JobHistoryActionName { + /** Enum value MainAction. */ + MAIN_ACTION("MainAction"), + + /** Enum value ErrorAction. */ + ERROR_ACTION("ErrorAction"); + + /** The actual serialized value for a JobHistoryActionName instance. */ + private String value; + + JobHistoryActionName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobHistoryActionName instance. + * + * @param value the serialized value to parse. + * @return the parsed JobHistoryActionName object, or null if unable to parse. + */ + @JsonCreator + public static JobHistoryActionName fromString(String value) { + JobHistoryActionName[] items = JobHistoryActionName.values(); + for (JobHistoryActionName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryDefinition.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryDefinition.java new file mode 100644 index 000000000000..f47b56290508 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryDefinition.java @@ -0,0 +1,40 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.SchedulerManager; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.JobHistoryDefinitionInner; + +/** + * Type representing JobHistoryDefinition. + */ +public interface JobHistoryDefinition extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + JobHistoryDefinitionProperties properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryDefinitionProperties.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryDefinitionProperties.java new file mode 100644 index 000000000000..a192136b29c4 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryDefinitionProperties.java @@ -0,0 +1,140 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobHistoryDefinitionProperties model. + */ +public class JobHistoryDefinitionProperties { + /** + * Gets the start time for this job. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * Gets the end time for this job. + */ + @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime endTime; + + /** + * Gets the expected execution time for this job. + */ + @JsonProperty(value = "expectedExecutionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime expectedExecutionTime; + + /** + * Gets the job history action name. Possible values include: 'MainAction', + * 'ErrorAction'. + */ + @JsonProperty(value = "actionName", access = JsonProperty.Access.WRITE_ONLY) + private JobHistoryActionName actionName; + + /** + * Gets the job history status. Possible values include: 'Completed', + * 'Failed', 'Postponed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private JobExecutionStatus status; + + /** + * Gets the message for the job history. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Gets the retry count for job. + */ + @JsonProperty(value = "retryCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer retryCount; + + /** + * Gets the repeat count for the job. + */ + @JsonProperty(value = "repeatCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer repeatCount; + + /** + * Get gets the start time for this job. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get gets the end time for this job. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Get gets the expected execution time for this job. + * + * @return the expectedExecutionTime value + */ + public DateTime expectedExecutionTime() { + return this.expectedExecutionTime; + } + + /** + * Get gets the job history action name. Possible values include: 'MainAction', 'ErrorAction'. + * + * @return the actionName value + */ + public JobHistoryActionName actionName() { + return this.actionName; + } + + /** + * Get gets the job history status. Possible values include: 'Completed', 'Failed', 'Postponed'. + * + * @return the status value + */ + public JobExecutionStatus status() { + return this.status; + } + + /** + * Get gets the message for the job history. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get gets the retry count for job. + * + * @return the retryCount value + */ + public Integer retryCount() { + return this.retryCount; + } + + /** + * Get gets the repeat count for the job. + * + * @return the repeatCount value + */ + public Integer repeatCount() { + return this.repeatCount; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryFilter.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryFilter.java new file mode 100644 index 000000000000..729274742a2b --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobHistoryFilter.java @@ -0,0 +1,44 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobHistoryFilter model. + */ +public class JobHistoryFilter { + /** + * Gets or sets the job execution status. Possible values include: + * 'Completed', 'Failed', 'Postponed'. + */ + @JsonProperty(value = "status") + private JobExecutionStatus status; + + /** + * Get gets or sets the job execution status. Possible values include: 'Completed', 'Failed', 'Postponed'. + * + * @return the status value + */ + public JobExecutionStatus status() { + return this.status; + } + + /** + * Set gets or sets the job execution status. Possible values include: 'Completed', 'Failed', 'Postponed'. + * + * @param status the status value to set + * @return the JobHistoryFilter object itself. + */ + public JobHistoryFilter withStatus(JobExecutionStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobMaxRecurrence.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobMaxRecurrence.java new file mode 100644 index 000000000000..7be8b4bf3cc8 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobMaxRecurrence.java @@ -0,0 +1,71 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobMaxRecurrence model. + */ +public class JobMaxRecurrence { + /** + * Gets or sets the frequency of recurrence (second, minute, hour, day, + * week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', + * 'Month'. + */ + @JsonProperty(value = "frequency") + private RecurrenceFrequency frequency; + + /** + * Gets or sets the interval between retries. + */ + @JsonProperty(value = "interval") + private Integer interval; + + /** + * Get gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'. + * + * @return the frequency value + */ + public RecurrenceFrequency frequency() { + return this.frequency; + } + + /** + * Set gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'. + * + * @param frequency the frequency value to set + * @return the JobMaxRecurrence object itself. + */ + public JobMaxRecurrence withFrequency(RecurrenceFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get gets or sets the interval between retries. + * + * @return the interval value + */ + public Integer interval() { + return this.interval; + } + + /** + * Set gets or sets the interval between retries. + * + * @param interval the interval value to set + * @return the JobMaxRecurrence object itself. + */ + public JobMaxRecurrence withInterval(Integer interval) { + this.interval = interval; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobProperties.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobProperties.java new file mode 100644 index 000000000000..bf59237c47c3 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobProperties.java @@ -0,0 +1,138 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobProperties model. + */ +public class JobProperties { + /** + * Gets or sets the job start time. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Gets or sets the job action. + */ + @JsonProperty(value = "action") + private JobAction action; + + /** + * Gets or sets the job recurrence. + */ + @JsonProperty(value = "recurrence") + private JobRecurrence recurrence; + + /** + * Gets or set the job state. Possible values include: 'Enabled', + * 'Disabled', 'Faulted', 'Completed'. + */ + @JsonProperty(value = "state") + private JobState state; + + /** + * Gets the job status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private JobStatus status; + + /** + * Get gets or sets the job start time. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set gets or sets the job start time. + * + * @param startTime the startTime value to set + * @return the JobProperties object itself. + */ + public JobProperties withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get gets or sets the job action. + * + * @return the action value + */ + public JobAction action() { + return this.action; + } + + /** + * Set gets or sets the job action. + * + * @param action the action value to set + * @return the JobProperties object itself. + */ + public JobProperties withAction(JobAction action) { + this.action = action; + return this; + } + + /** + * Get gets or sets the job recurrence. + * + * @return the recurrence value + */ + public JobRecurrence recurrence() { + return this.recurrence; + } + + /** + * Set gets or sets the job recurrence. + * + * @param recurrence the recurrence value to set + * @return the JobProperties object itself. + */ + public JobProperties withRecurrence(JobRecurrence recurrence) { + this.recurrence = recurrence; + return this; + } + + /** + * Get gets or set the job state. Possible values include: 'Enabled', 'Disabled', 'Faulted', 'Completed'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Set gets or set the job state. Possible values include: 'Enabled', 'Disabled', 'Faulted', 'Completed'. + * + * @param state the state value to set + * @return the JobProperties object itself. + */ + public JobProperties withState(JobState state) { + this.state = state; + return this; + } + + /** + * Get gets the job status. + * + * @return the status value + */ + public JobStatus status() { + return this.status; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrence.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrence.java new file mode 100644 index 000000000000..251b55640917 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrence.java @@ -0,0 +1,150 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobRecurrence model. + */ +public class JobRecurrence { + /** + * Gets or sets the frequency of recurrence (second, minute, hour, day, + * week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', + * 'Month'. + */ + @JsonProperty(value = "frequency") + private RecurrenceFrequency frequency; + + /** + * Gets or sets the interval between retries. + */ + @JsonProperty(value = "interval") + private Integer interval; + + /** + * Gets or sets the maximum number of times that the job should run. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Gets or sets the time at which the job will complete. + */ + @JsonProperty(value = "endTime") + private DateTime endTime; + + /** + * The schedule property. + */ + @JsonProperty(value = "schedule") + private JobRecurrenceSchedule schedule; + + /** + * Get gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'. + * + * @return the frequency value + */ + public RecurrenceFrequency frequency() { + return this.frequency; + } + + /** + * Set gets or sets the frequency of recurrence (second, minute, hour, day, week, month). Possible values include: 'Minute', 'Hour', 'Day', 'Week', 'Month'. + * + * @param frequency the frequency value to set + * @return the JobRecurrence object itself. + */ + public JobRecurrence withFrequency(RecurrenceFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get gets or sets the interval between retries. + * + * @return the interval value + */ + public Integer interval() { + return this.interval; + } + + /** + * Set gets or sets the interval between retries. + * + * @param interval the interval value to set + * @return the JobRecurrence object itself. + */ + public JobRecurrence withInterval(Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get gets or sets the maximum number of times that the job should run. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set gets or sets the maximum number of times that the job should run. + * + * @param count the count value to set + * @return the JobRecurrence object itself. + */ + public JobRecurrence withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get gets or sets the time at which the job will complete. + * + * @return the endTime value + */ + public DateTime endTime() { + return this.endTime; + } + + /** + * Set gets or sets the time at which the job will complete. + * + * @param endTime the endTime value to set + * @return the JobRecurrence object itself. + */ + public JobRecurrence withEndTime(DateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the schedule value. + * + * @return the schedule value + */ + public JobRecurrenceSchedule schedule() { + return this.schedule; + } + + /** + * Set the schedule value. + * + * @param schedule the schedule value to set + * @return the JobRecurrence object itself. + */ + public JobRecurrence withSchedule(JobRecurrenceSchedule schedule) { + this.schedule = schedule; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrenceSchedule.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrenceSchedule.java new file mode 100644 index 000000000000..eac04510fb74 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrenceSchedule.java @@ -0,0 +1,149 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobRecurrenceSchedule model. + */ +public class JobRecurrenceSchedule { + /** + * Gets or sets the days of the week that the job should execute on. + */ + @JsonProperty(value = "weekDays") + private List weekDays; + + /** + * Gets or sets the hours of the day that the job should execute at. + */ + @JsonProperty(value = "hours") + private List hours; + + /** + * Gets or sets the minutes of the hour that the job should execute at. + */ + @JsonProperty(value = "minutes") + private List minutes; + + /** + * Gets or sets the days of the month that the job should execute on. Must + * be between 1 and 31. + */ + @JsonProperty(value = "monthDays") + private List monthDays; + + /** + * Gets or sets the occurrences of days within a month. + */ + @JsonProperty(value = "monthlyOccurrences") + private List monthlyOccurrences; + + /** + * Get gets or sets the days of the week that the job should execute on. + * + * @return the weekDays value + */ + public List weekDays() { + return this.weekDays; + } + + /** + * Set gets or sets the days of the week that the job should execute on. + * + * @param weekDays the weekDays value to set + * @return the JobRecurrenceSchedule object itself. + */ + public JobRecurrenceSchedule withWeekDays(List weekDays) { + this.weekDays = weekDays; + return this; + } + + /** + * Get gets or sets the hours of the day that the job should execute at. + * + * @return the hours value + */ + public List hours() { + return this.hours; + } + + /** + * Set gets or sets the hours of the day that the job should execute at. + * + * @param hours the hours value to set + * @return the JobRecurrenceSchedule object itself. + */ + public JobRecurrenceSchedule withHours(List hours) { + this.hours = hours; + return this; + } + + /** + * Get gets or sets the minutes of the hour that the job should execute at. + * + * @return the minutes value + */ + public List minutes() { + return this.minutes; + } + + /** + * Set gets or sets the minutes of the hour that the job should execute at. + * + * @param minutes the minutes value to set + * @return the JobRecurrenceSchedule object itself. + */ + public JobRecurrenceSchedule withMinutes(List minutes) { + this.minutes = minutes; + return this; + } + + /** + * Get gets or sets the days of the month that the job should execute on. Must be between 1 and 31. + * + * @return the monthDays value + */ + public List monthDays() { + return this.monthDays; + } + + /** + * Set gets or sets the days of the month that the job should execute on. Must be between 1 and 31. + * + * @param monthDays the monthDays value to set + * @return the JobRecurrenceSchedule object itself. + */ + public JobRecurrenceSchedule withMonthDays(List monthDays) { + this.monthDays = monthDays; + return this; + } + + /** + * Get gets or sets the occurrences of days within a month. + * + * @return the monthlyOccurrences value + */ + public List monthlyOccurrences() { + return this.monthlyOccurrences; + } + + /** + * Set gets or sets the occurrences of days within a month. + * + * @param monthlyOccurrences the monthlyOccurrences value to set + * @return the JobRecurrenceSchedule object itself. + */ + public JobRecurrenceSchedule withMonthlyOccurrences(List monthlyOccurrences) { + this.monthlyOccurrences = monthlyOccurrences; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrenceScheduleMonthlyOccurrence.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrenceScheduleMonthlyOccurrence.java new file mode 100644 index 000000000000..0ec9f2366d6e --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobRecurrenceScheduleMonthlyOccurrence.java @@ -0,0 +1,71 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobRecurrenceScheduleMonthlyOccurrence model. + */ +public class JobRecurrenceScheduleMonthlyOccurrence { + /** + * Gets or sets the day. Must be one of monday, tuesday, wednesday, + * thursday, friday, saturday, sunday. Possible values include: 'Monday', + * 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'. + */ + @JsonProperty(value = "day") + private JobScheduleDay day; + + /** + * Gets or sets the occurrence. Must be between -5 and 5. + */ + @JsonProperty(value = "Occurrence") + private Integer occurrence; + + /** + * Get gets or sets the day. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'. + * + * @return the day value + */ + public JobScheduleDay day() { + return this.day; + } + + /** + * Set gets or sets the day. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'. + * + * @param day the day value to set + * @return the JobRecurrenceScheduleMonthlyOccurrence object itself. + */ + public JobRecurrenceScheduleMonthlyOccurrence withDay(JobScheduleDay day) { + this.day = day; + return this; + } + + /** + * Get gets or sets the occurrence. Must be between -5 and 5. + * + * @return the occurrence value + */ + public Integer occurrence() { + return this.occurrence; + } + + /** + * Set gets or sets the occurrence. Must be between -5 and 5. + * + * @param occurrence the occurrence value to set + * @return the JobRecurrenceScheduleMonthlyOccurrence object itself. + */ + public JobRecurrenceScheduleMonthlyOccurrence withOccurrence(Integer occurrence) { + this.occurrence = occurrence; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobScheduleDay.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobScheduleDay.java new file mode 100644 index 000000000000..f2858c497ae7 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobScheduleDay.java @@ -0,0 +1,68 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobScheduleDay. + */ +public enum JobScheduleDay { + /** Enum value Monday. */ + MONDAY("Monday"), + + /** Enum value Tuesday. */ + TUESDAY("Tuesday"), + + /** Enum value Wednesday. */ + WEDNESDAY("Wednesday"), + + /** Enum value Thursday. */ + THURSDAY("Thursday"), + + /** Enum value Friday. */ + FRIDAY("Friday"), + + /** Enum value Saturday. */ + SATURDAY("Saturday"), + + /** Enum value Sunday. */ + SUNDAY("Sunday"); + + /** The actual serialized value for a JobScheduleDay instance. */ + private String value; + + JobScheduleDay(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobScheduleDay instance. + * + * @param value the serialized value to parse. + * @return the parsed JobScheduleDay object, or null if unable to parse. + */ + @JsonCreator + public static JobScheduleDay fromString(String value) { + JobScheduleDay[] items = JobScheduleDay.values(); + for (JobScheduleDay item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobState.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobState.java new file mode 100644 index 000000000000..27135d30455e --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobState.java @@ -0,0 +1,59 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for JobState. + */ +public enum JobState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Faulted. */ + FAULTED("Faulted"), + + /** Enum value Completed. */ + COMPLETED("Completed"); + + /** The actual serialized value for a JobState instance. */ + private String value; + + JobState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a JobState instance. + * + * @param value the serialized value to parse. + * @return the parsed JobState object, or null if unable to parse. + */ + @JsonCreator + public static JobState fromString(String value) { + JobState[] items = JobState.values(); + for (JobState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobStateFilter.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobStateFilter.java new file mode 100644 index 000000000000..4e8514b908c2 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobStateFilter.java @@ -0,0 +1,44 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobStateFilter model. + */ +public class JobStateFilter { + /** + * Gets or sets the job state. Possible values include: 'Enabled', + * 'Disabled', 'Faulted', 'Completed'. + */ + @JsonProperty(value = "state") + private JobState state; + + /** + * Get gets or sets the job state. Possible values include: 'Enabled', 'Disabled', 'Faulted', 'Completed'. + * + * @return the state value + */ + public JobState state() { + return this.state; + } + + /** + * Set gets or sets the job state. Possible values include: 'Enabled', 'Disabled', 'Faulted', 'Completed'. + * + * @param state the state value to set + * @return the JobStateFilter object itself. + */ + public JobStateFilter withState(JobState state) { + this.state = state; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobStatus.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobStatus.java new file mode 100644 index 000000000000..8bc5e11a0e29 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/JobStatus.java @@ -0,0 +1,96 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobStatus model. + */ +public class JobStatus { + /** + * Gets the number of times this job has executed. + */ + @JsonProperty(value = "executionCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer executionCount; + + /** + * Gets the number of times this job has failed. + */ + @JsonProperty(value = "failureCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer failureCount; + + /** + * Gets the number of faulted occurrences (occurrences that were retried + * and failed as many times as the retry policy states). + */ + @JsonProperty(value = "faultedCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer faultedCount; + + /** + * Gets the time the last occurrence executed in ISO-8601 format. Could be + * empty if job has not run yet. + */ + @JsonProperty(value = "lastExecutionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastExecutionTime; + + /** + * Gets the time of the next occurrence in ISO-8601 format. Could be empty + * if the job is completed. + */ + @JsonProperty(value = "nextExecutionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime nextExecutionTime; + + /** + * Get gets the number of times this job has executed. + * + * @return the executionCount value + */ + public Integer executionCount() { + return this.executionCount; + } + + /** + * Get gets the number of times this job has failed. + * + * @return the failureCount value + */ + public Integer failureCount() { + return this.failureCount; + } + + /** + * Get gets the number of faulted occurrences (occurrences that were retried and failed as many times as the retry policy states). + * + * @return the faultedCount value + */ + public Integer faultedCount() { + return this.faultedCount; + } + + /** + * Get gets the time the last occurrence executed in ISO-8601 format. Could be empty if job has not run yet. + * + * @return the lastExecutionTime value + */ + public DateTime lastExecutionTime() { + return this.lastExecutionTime; + } + + /** + * Get gets the time of the next occurrence in ISO-8601 format. Could be empty if the job is completed. + * + * @return the nextExecutionTime value + */ + public DateTime nextExecutionTime() { + return this.nextExecutionTime; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/Jobs.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/Jobs.java new file mode 100644 index 000000000000..6f3fbc9c710b --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/Jobs.java @@ -0,0 +1,75 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation.JobsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Jobs. + */ +public interface Jobs extends SupportsCreating, HasInner { + /** + * Runs a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable runAsync(String resourceGroupName, String jobCollectionName, String jobName); + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listJobHistoryAsync(final String resourceGroupName, final String jobCollectionName, final String jobName); + + /** + * Gets a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String jobCollectionName, String jobName); + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String jobCollectionName); + + /** + * Deletes a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String jobCollectionName, String jobName); + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/OAuthAuthentication.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/OAuthAuthentication.java new file mode 100644 index 000000000000..4a4acf715921 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/OAuthAuthentication.java @@ -0,0 +1,121 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OAuthAuthentication model. + */ +public class OAuthAuthentication extends HttpAuthentication { + /** + * Gets or sets the secret. + */ + @JsonProperty(value = "secret") + private String secret; + + /** + * Gets or sets the tenant. + */ + @JsonProperty(value = "tenant") + private String tenant; + + /** + * Gets or sets the audience. + */ + @JsonProperty(value = "audience") + private String audience; + + /** + * Gets or sets the client identifier. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get gets or sets the secret. + * + * @return the secret value + */ + public String secret() { + return this.secret; + } + + /** + * Set gets or sets the secret. + * + * @param secret the secret value to set + * @return the OAuthAuthentication object itself. + */ + public OAuthAuthentication withSecret(String secret) { + this.secret = secret; + return this; + } + + /** + * Get gets or sets the tenant. + * + * @return the tenant value + */ + public String tenant() { + return this.tenant; + } + + /** + * Set gets or sets the tenant. + * + * @param tenant the tenant value to set + * @return the OAuthAuthentication object itself. + */ + public OAuthAuthentication withTenant(String tenant) { + this.tenant = tenant; + return this; + } + + /** + * Get gets or sets the audience. + * + * @return the audience value + */ + public String audience() { + return this.audience; + } + + /** + * Set gets or sets the audience. + * + * @param audience the audience value to set + * @return the OAuthAuthentication object itself. + */ + public OAuthAuthentication withAudience(String audience) { + this.audience = audience; + return this; + } + + /** + * Get gets or sets the client identifier. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set gets or sets the client identifier. + * + * @param clientId the clientId value to set + * @return the OAuthAuthentication object itself. + */ + public OAuthAuthentication withClientId(String clientId) { + this.clientId = clientId; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RecurrenceFrequency.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RecurrenceFrequency.java new file mode 100644 index 000000000000..3fdacb1fecd1 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RecurrenceFrequency.java @@ -0,0 +1,62 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RecurrenceFrequency. + */ +public enum RecurrenceFrequency { + /** Enum value Minute. */ + MINUTE("Minute"), + + /** Enum value Hour. */ + HOUR("Hour"), + + /** Enum value Day. */ + DAY("Day"), + + /** Enum value Week. */ + WEEK("Week"), + + /** Enum value Month. */ + MONTH("Month"); + + /** The actual serialized value for a RecurrenceFrequency instance. */ + private String value; + + RecurrenceFrequency(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecurrenceFrequency instance. + * + * @param value the serialized value to parse. + * @return the parsed RecurrenceFrequency object, or null if unable to parse. + */ + @JsonCreator + public static RecurrenceFrequency fromString(String value) { + RecurrenceFrequency[] items = RecurrenceFrequency.values(); + for (RecurrenceFrequency item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RetryPolicy.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RetryPolicy.java new file mode 100644 index 000000000000..e1b3ca63eb55 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RetryPolicy.java @@ -0,0 +1,97 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The RetryPolicy model. + */ +public class RetryPolicy { + /** + * Gets or sets the retry strategy to be used. Possible values include: + * 'None', 'Fixed'. + */ + @JsonProperty(value = "retryType") + private RetryType retryType; + + /** + * Gets or sets the retry interval between retries. + */ + @JsonProperty(value = "retryInterval") + private Period retryInterval; + + /** + * Gets or sets the number of times a retry should be attempted. + */ + @JsonProperty(value = "retryCount") + private Integer retryCount; + + /** + * Get gets or sets the retry strategy to be used. Possible values include: 'None', 'Fixed'. + * + * @return the retryType value + */ + public RetryType retryType() { + return this.retryType; + } + + /** + * Set gets or sets the retry strategy to be used. Possible values include: 'None', 'Fixed'. + * + * @param retryType the retryType value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withRetryType(RetryType retryType) { + this.retryType = retryType; + return this; + } + + /** + * Get gets or sets the retry interval between retries. + * + * @return the retryInterval value + */ + public Period retryInterval() { + return this.retryInterval; + } + + /** + * Set gets or sets the retry interval between retries. + * + * @param retryInterval the retryInterval value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withRetryInterval(Period retryInterval) { + this.retryInterval = retryInterval; + return this; + } + + /** + * Get gets or sets the number of times a retry should be attempted. + * + * @return the retryCount value + */ + public Integer retryCount() { + return this.retryCount; + } + + /** + * Set gets or sets the number of times a retry should be attempted. + * + * @param retryCount the retryCount value to set + * @return the RetryPolicy object itself. + */ + public RetryPolicy withRetryCount(Integer retryCount) { + this.retryCount = retryCount; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RetryType.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RetryType.java new file mode 100644 index 000000000000..8daf558447da --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/RetryType.java @@ -0,0 +1,53 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RetryType. + */ +public enum RetryType { + /** Enum value None. */ + NONE("None"), + + /** Enum value Fixed. */ + FIXED("Fixed"); + + /** The actual serialized value for a RetryType instance. */ + private String value; + + RetryType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RetryType instance. + * + * @param value the serialized value to parse. + * @return the parsed RetryType object, or null if unable to parse. + */ + @JsonCreator + public static RetryType fromString(String value) { + RetryType[] items = RetryType.values(); + for (RetryType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusAuthentication.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusAuthentication.java new file mode 100644 index 000000000000..d8305449e0fb --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusAuthentication.java @@ -0,0 +1,96 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ServiceBusAuthentication model. + */ +public class ServiceBusAuthentication { + /** + * Gets or sets the SAS key. + */ + @JsonProperty(value = "sasKey") + private String sasKey; + + /** + * Gets or sets the SAS key name. + */ + @JsonProperty(value = "sasKeyName") + private String sasKeyName; + + /** + * Gets or sets the authentication type. Possible values include: + * 'NotSpecified', 'SharedAccessKey'. + */ + @JsonProperty(value = "type") + private ServiceBusAuthenticationType type; + + /** + * Get gets or sets the SAS key. + * + * @return the sasKey value + */ + public String sasKey() { + return this.sasKey; + } + + /** + * Set gets or sets the SAS key. + * + * @param sasKey the sasKey value to set + * @return the ServiceBusAuthentication object itself. + */ + public ServiceBusAuthentication withSasKey(String sasKey) { + this.sasKey = sasKey; + return this; + } + + /** + * Get gets or sets the SAS key name. + * + * @return the sasKeyName value + */ + public String sasKeyName() { + return this.sasKeyName; + } + + /** + * Set gets or sets the SAS key name. + * + * @param sasKeyName the sasKeyName value to set + * @return the ServiceBusAuthentication object itself. + */ + public ServiceBusAuthentication withSasKeyName(String sasKeyName) { + this.sasKeyName = sasKeyName; + return this; + } + + /** + * Get gets or sets the authentication type. Possible values include: 'NotSpecified', 'SharedAccessKey'. + * + * @return the type value + */ + public ServiceBusAuthenticationType type() { + return this.type; + } + + /** + * Set gets or sets the authentication type. Possible values include: 'NotSpecified', 'SharedAccessKey'. + * + * @param type the type value to set + * @return the ServiceBusAuthentication object itself. + */ + public ServiceBusAuthentication withType(ServiceBusAuthenticationType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusAuthenticationType.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusAuthenticationType.java new file mode 100644 index 000000000000..38029ca30b63 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusAuthenticationType.java @@ -0,0 +1,53 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServiceBusAuthenticationType. + */ +public enum ServiceBusAuthenticationType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value SharedAccessKey. */ + SHARED_ACCESS_KEY("SharedAccessKey"); + + /** The actual serialized value for a ServiceBusAuthenticationType instance. */ + private String value; + + ServiceBusAuthenticationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServiceBusAuthenticationType instance. + * + * @param value the serialized value to parse. + * @return the parsed ServiceBusAuthenticationType object, or null if unable to parse. + */ + @JsonCreator + public static ServiceBusAuthenticationType fromString(String value) { + ServiceBusAuthenticationType[] items = ServiceBusAuthenticationType.values(); + for (ServiceBusAuthenticationType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusBrokeredMessageProperties.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusBrokeredMessageProperties.java new file mode 100644 index 000000000000..eaff41ad5422 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusBrokeredMessageProperties.java @@ -0,0 +1,356 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ServiceBusBrokeredMessageProperties model. + */ +public class ServiceBusBrokeredMessageProperties { + /** + * Gets or sets the content type. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * Gets or sets the correlation id. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /** + * Gets or sets the force persistence. + */ + @JsonProperty(value = "forcePersistence") + private Boolean forcePersistence; + + /** + * Gets or sets the label. + */ + @JsonProperty(value = "label") + private String label; + + /** + * Gets or sets the message id. + */ + @JsonProperty(value = "messageId") + private String messageId; + + /** + * Gets or sets the partition key. + */ + @JsonProperty(value = "partitionKey") + private String partitionKey; + + /** + * Gets or sets the reply to. + */ + @JsonProperty(value = "replyTo") + private String replyTo; + + /** + * Gets or sets the reply to session id. + */ + @JsonProperty(value = "replyToSessionId") + private String replyToSessionId; + + /** + * Gets or sets the scheduled enqueue time UTC. + */ + @JsonProperty(value = "scheduledEnqueueTimeUtc") + private DateTime scheduledEnqueueTimeUtc; + + /** + * Gets or sets the session id. + */ + @JsonProperty(value = "sessionId") + private String sessionId; + + /** + * Gets or sets the time to live. + */ + @JsonProperty(value = "timeToLive") + private DateTime timeToLive; + + /** + * Gets or sets the to. + */ + @JsonProperty(value = "to") + private String to; + + /** + * Gets or sets the via partition key. + */ + @JsonProperty(value = "viaPartitionKey") + private String viaPartitionKey; + + /** + * Get gets or sets the content type. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set gets or sets the content type. + * + * @param contentType the contentType value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get gets or sets the correlation id. + * + * @return the correlationId value + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set gets or sets the correlation id. + * + * @param correlationId the correlationId value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get gets or sets the force persistence. + * + * @return the forcePersistence value + */ + public Boolean forcePersistence() { + return this.forcePersistence; + } + + /** + * Set gets or sets the force persistence. + * + * @param forcePersistence the forcePersistence value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withForcePersistence(Boolean forcePersistence) { + this.forcePersistence = forcePersistence; + return this; + } + + /** + * Get gets or sets the label. + * + * @return the label value + */ + public String label() { + return this.label; + } + + /** + * Set gets or sets the label. + * + * @param label the label value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get gets or sets the message id. + * + * @return the messageId value + */ + public String messageId() { + return this.messageId; + } + + /** + * Set gets or sets the message id. + * + * @param messageId the messageId value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withMessageId(String messageId) { + this.messageId = messageId; + return this; + } + + /** + * Get gets or sets the partition key. + * + * @return the partitionKey value + */ + public String partitionKey() { + return this.partitionKey; + } + + /** + * Set gets or sets the partition key. + * + * @param partitionKey the partitionKey value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withPartitionKey(String partitionKey) { + this.partitionKey = partitionKey; + return this; + } + + /** + * Get gets or sets the reply to. + * + * @return the replyTo value + */ + public String replyTo() { + return this.replyTo; + } + + /** + * Set gets or sets the reply to. + * + * @param replyTo the replyTo value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withReplyTo(String replyTo) { + this.replyTo = replyTo; + return this; + } + + /** + * Get gets or sets the reply to session id. + * + * @return the replyToSessionId value + */ + public String replyToSessionId() { + return this.replyToSessionId; + } + + /** + * Set gets or sets the reply to session id. + * + * @param replyToSessionId the replyToSessionId value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withReplyToSessionId(String replyToSessionId) { + this.replyToSessionId = replyToSessionId; + return this; + } + + /** + * Get gets or sets the scheduled enqueue time UTC. + * + * @return the scheduledEnqueueTimeUtc value + */ + public DateTime scheduledEnqueueTimeUtc() { + return this.scheduledEnqueueTimeUtc; + } + + /** + * Set gets or sets the scheduled enqueue time UTC. + * + * @param scheduledEnqueueTimeUtc the scheduledEnqueueTimeUtc value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withScheduledEnqueueTimeUtc(DateTime scheduledEnqueueTimeUtc) { + this.scheduledEnqueueTimeUtc = scheduledEnqueueTimeUtc; + return this; + } + + /** + * Get gets or sets the session id. + * + * @return the sessionId value + */ + public String sessionId() { + return this.sessionId; + } + + /** + * Set gets or sets the session id. + * + * @param sessionId the sessionId value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Get gets or sets the time to live. + * + * @return the timeToLive value + */ + public DateTime timeToLive() { + return this.timeToLive; + } + + /** + * Set gets or sets the time to live. + * + * @param timeToLive the timeToLive value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withTimeToLive(DateTime timeToLive) { + this.timeToLive = timeToLive; + return this; + } + + /** + * Get gets or sets the to. + * + * @return the to value + */ + public String to() { + return this.to; + } + + /** + * Set gets or sets the to. + * + * @param to the to value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withTo(String to) { + this.to = to; + return this; + } + + /** + * Get gets or sets the via partition key. + * + * @return the viaPartitionKey value + */ + public String viaPartitionKey() { + return this.viaPartitionKey; + } + + /** + * Set gets or sets the via partition key. + * + * @param viaPartitionKey the viaPartitionKey value to set + * @return the ServiceBusBrokeredMessageProperties object itself. + */ + public ServiceBusBrokeredMessageProperties withViaPartitionKey(String viaPartitionKey) { + this.viaPartitionKey = viaPartitionKey; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusMessage.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusMessage.java new file mode 100644 index 000000000000..529673318419 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusMessage.java @@ -0,0 +1,175 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ServiceBusMessage model. + */ +public class ServiceBusMessage { + /** + * Gets or sets the authentication. + */ + @JsonProperty(value = "authentication") + private ServiceBusAuthentication authentication; + + /** + * Gets or sets the brokered message properties. + */ + @JsonProperty(value = "brokeredMessageProperties") + private ServiceBusBrokeredMessageProperties brokeredMessageProperties; + + /** + * Gets or sets the custom message properties. + */ + @JsonProperty(value = "customMessageProperties") + private Map customMessageProperties; + + /** + * Gets or sets the message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Gets or sets the namespace. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /** + * Gets or sets the transport type. Possible values include: + * 'NotSpecified', 'NetMessaging', 'AMQP'. + */ + @JsonProperty(value = "transportType") + private ServiceBusTransportType transportType; + + /** + * Get gets or sets the authentication. + * + * @return the authentication value + */ + public ServiceBusAuthentication authentication() { + return this.authentication; + } + + /** + * Set gets or sets the authentication. + * + * @param authentication the authentication value to set + * @return the ServiceBusMessage object itself. + */ + public ServiceBusMessage withAuthentication(ServiceBusAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get gets or sets the brokered message properties. + * + * @return the brokeredMessageProperties value + */ + public ServiceBusBrokeredMessageProperties brokeredMessageProperties() { + return this.brokeredMessageProperties; + } + + /** + * Set gets or sets the brokered message properties. + * + * @param brokeredMessageProperties the brokeredMessageProperties value to set + * @return the ServiceBusMessage object itself. + */ + public ServiceBusMessage withBrokeredMessageProperties(ServiceBusBrokeredMessageProperties brokeredMessageProperties) { + this.brokeredMessageProperties = brokeredMessageProperties; + return this; + } + + /** + * Get gets or sets the custom message properties. + * + * @return the customMessageProperties value + */ + public Map customMessageProperties() { + return this.customMessageProperties; + } + + /** + * Set gets or sets the custom message properties. + * + * @param customMessageProperties the customMessageProperties value to set + * @return the ServiceBusMessage object itself. + */ + public ServiceBusMessage withCustomMessageProperties(Map customMessageProperties) { + this.customMessageProperties = customMessageProperties; + return this; + } + + /** + * Get gets or sets the message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set gets or sets the message. + * + * @param message the message value to set + * @return the ServiceBusMessage object itself. + */ + public ServiceBusMessage withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get gets or sets the namespace. + * + * @return the namespace value + */ + public String namespace() { + return this.namespace; + } + + /** + * Set gets or sets the namespace. + * + * @param namespace the namespace value to set + * @return the ServiceBusMessage object itself. + */ + public ServiceBusMessage withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get gets or sets the transport type. Possible values include: 'NotSpecified', 'NetMessaging', 'AMQP'. + * + * @return the transportType value + */ + public ServiceBusTransportType transportType() { + return this.transportType; + } + + /** + * Set gets or sets the transport type. Possible values include: 'NotSpecified', 'NetMessaging', 'AMQP'. + * + * @param transportType the transportType value to set + * @return the ServiceBusMessage object itself. + */ + public ServiceBusMessage withTransportType(ServiceBusTransportType transportType) { + this.transportType = transportType; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusQueueMessage.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusQueueMessage.java new file mode 100644 index 000000000000..5ffc070843cb --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusQueueMessage.java @@ -0,0 +1,43 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ServiceBusQueueMessage model. + */ +public class ServiceBusQueueMessage extends ServiceBusMessage { + /** + * Gets or sets the queue name. + */ + @JsonProperty(value = "queueName") + private String queueName; + + /** + * Get gets or sets the queue name. + * + * @return the queueName value + */ + public String queueName() { + return this.queueName; + } + + /** + * Set gets or sets the queue name. + * + * @param queueName the queueName value to set + * @return the ServiceBusQueueMessage object itself. + */ + public ServiceBusQueueMessage withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusTopicMessage.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusTopicMessage.java new file mode 100644 index 000000000000..0fe7d17600e9 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusTopicMessage.java @@ -0,0 +1,43 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ServiceBusTopicMessage model. + */ +public class ServiceBusTopicMessage extends ServiceBusMessage { + /** + * Gets or sets the topic path. + */ + @JsonProperty(value = "topicPath") + private String topicPath; + + /** + * Get gets or sets the topic path. + * + * @return the topicPath value + */ + public String topicPath() { + return this.topicPath; + } + + /** + * Set gets or sets the topic path. + * + * @param topicPath the topicPath value to set + * @return the ServiceBusTopicMessage object itself. + */ + public ServiceBusTopicMessage withTopicPath(String topicPath) { + this.topicPath = topicPath; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusTransportType.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusTransportType.java new file mode 100644 index 000000000000..6dd9d65a7d1e --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/ServiceBusTransportType.java @@ -0,0 +1,56 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ServiceBusTransportType. + */ +public enum ServiceBusTransportType { + /** Enum value NotSpecified. */ + NOT_SPECIFIED("NotSpecified"), + + /** Enum value NetMessaging. */ + NET_MESSAGING("NetMessaging"), + + /** Enum value AMQP. */ + AMQP("AMQP"); + + /** The actual serialized value for a ServiceBusTransportType instance. */ + private String value; + + ServiceBusTransportType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ServiceBusTransportType instance. + * + * @param value the serialized value to parse. + * @return the parsed ServiceBusTransportType object, or null if unable to parse. + */ + @JsonCreator + public static ServiceBusTransportType fromString(String value) { + ServiceBusTransportType[] items = ServiceBusTransportType.values(); + for (ServiceBusTransportType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/Sku.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/Sku.java new file mode 100644 index 000000000000..1fb553c8a04a --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/Sku.java @@ -0,0 +1,44 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku model. + */ +public class Sku { + /** + * Gets or set the SKU. Possible values include: 'Standard', 'Free', + * 'Premium'. + */ + @JsonProperty(value = "name") + private SkuDefinition name; + + /** + * Get gets or set the SKU. Possible values include: 'Standard', 'Free', 'Premium'. + * + * @return the name value + */ + public SkuDefinition name() { + return this.name; + } + + /** + * Set gets or set the SKU. Possible values include: 'Standard', 'Free', 'Premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuDefinition name) { + this.name = name; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/SkuDefinition.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/SkuDefinition.java new file mode 100644 index 000000000000..c401acdbd6de --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/SkuDefinition.java @@ -0,0 +1,56 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SkuDefinition. + */ +public enum SkuDefinition { + /** Enum value Standard. */ + STANDARD("Standard"), + + /** Enum value Free. */ + FREE("Free"), + + /** Enum value Premium. */ + PREMIUM("Premium"); + + /** The actual serialized value for a SkuDefinition instance. */ + private String value; + + SkuDefinition(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SkuDefinition instance. + * + * @param value the serialized value to parse. + * @return the parsed SkuDefinition object, or null if unable to parse. + */ + @JsonCreator + public static SkuDefinition fromString(String value) { + SkuDefinition[] items = SkuDefinition.values(); + for (SkuDefinition item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/StorageQueueMessage.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/StorageQueueMessage.java new file mode 100644 index 000000000000..61c0a1073b94 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/StorageQueueMessage.java @@ -0,0 +1,121 @@ +/** + * 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.management.scheduler.v2014_08_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The StorageQueueMessage model. + */ +public class StorageQueueMessage { + /** + * Gets or sets the storage account name. + */ + @JsonProperty(value = "storageAccount") + private String storageAccount; + + /** + * Gets or sets the queue name. + */ + @JsonProperty(value = "queueName") + private String queueName; + + /** + * Gets or sets the SAS key. + */ + @JsonProperty(value = "sasToken") + private String sasToken; + + /** + * Gets or sets the message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get gets or sets the storage account name. + * + * @return the storageAccount value + */ + public String storageAccount() { + return this.storageAccount; + } + + /** + * Set gets or sets the storage account name. + * + * @param storageAccount the storageAccount value to set + * @return the StorageQueueMessage object itself. + */ + public StorageQueueMessage withStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get gets or sets the queue name. + * + * @return the queueName value + */ + public String queueName() { + return this.queueName; + } + + /** + * Set gets or sets the queue name. + * + * @param queueName the queueName value to set + * @return the StorageQueueMessage object itself. + */ + public StorageQueueMessage withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get gets or sets the SAS key. + * + * @return the sasToken value + */ + public String sasToken() { + return this.sasToken; + } + + /** + * Set gets or sets the SAS key. + * + * @param sasToken the sasToken value to set + * @return the StorageQueueMessage object itself. + */ + public StorageQueueMessage withSasToken(String sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * Get gets or sets the message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set gets or sets the message. + * + * @param message the message value to set + * @return the StorageQueueMessage object itself. + */ + public StorageQueueMessage withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/IdParsingUtils.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..4a6629b33efb --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionDefinitionImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionDefinitionImpl.java new file mode 100644 index 000000000000..643f1bf73740 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionDefinitionImpl.java @@ -0,0 +1,58 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollectionDefinition; +import rx.Observable; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollectionProperties; + +class JobCollectionDefinitionImpl extends GroupableResourceCoreImpl implements JobCollectionDefinition, JobCollectionDefinition.Definition, JobCollectionDefinition.Update { + JobCollectionDefinitionImpl(String name, JobCollectionDefinitionInner inner, SchedulerManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + JobCollectionsInner client = this.manager().inner().jobCollections(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + JobCollectionsInner client = this.manager().inner().jobCollections(); + return client.patchAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + JobCollectionsInner client = this.manager().inner().jobCollections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public JobCollectionProperties properties() { + return this.inner().properties(); + } + + @Override + public JobCollectionDefinitionImpl withProperties(JobCollectionProperties properties) { + this.inner().withProperties(properties); + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionDefinitionInner.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionDefinitionInner.java new file mode 100644 index 000000000000..43b876a58a50 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionDefinitionInner.java @@ -0,0 +1,153 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import java.util.Map; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollectionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobCollectionDefinitionInner model. + */ +public class JobCollectionDefinitionInner { + /** + * Gets the job collection resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets the job collection resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets or sets the job collection resource name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Gets or sets the storage account location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Gets or sets the tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Gets or sets the job collection properties. + */ + @JsonProperty(value = "properties") + private JobCollectionProperties properties; + + /** + * Get gets the job collection resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get gets the job collection resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get gets or sets the job collection resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set gets or sets the job collection resource name. + * + * @param name the name value to set + * @return the JobCollectionDefinitionInner object itself. + */ + public JobCollectionDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get gets or sets the storage account location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set gets or sets the storage account location. + * + * @param location the location value to set + * @return the JobCollectionDefinitionInner object itself. + */ + public JobCollectionDefinitionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get gets or sets the tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set gets or sets the tags. + * + * @param tags the tags value to set + * @return the JobCollectionDefinitionInner object itself. + */ + public JobCollectionDefinitionInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get gets or sets the job collection properties. + * + * @return the properties value + */ + public JobCollectionProperties properties() { + return this.properties; + } + + /** + * Set gets or sets the job collection properties. + * + * @param properties the properties value to set + * @return the JobCollectionDefinitionInner object itself. + */ + public JobCollectionDefinitionInner withProperties(JobCollectionProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionsImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionsImpl.java new file mode 100644 index 000000000000..c546d68b16e5 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionsImpl.java @@ -0,0 +1,150 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollectionDefinition; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class JobCollectionsImpl extends GroupableResourcesCoreImpl implements JobCollections { + protected JobCollectionsImpl(SchedulerManager manager) { + super(manager.inner().jobCollections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + JobCollectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + JobCollectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + JobCollectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + JobCollectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public JobCollectionDefinition call(JobCollectionDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + JobCollectionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + JobCollectionsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public JobCollectionDefinition call(JobCollectionDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public JobCollectionDefinitionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable enableAsync(String resourceGroupName, String jobCollectionName) { + JobCollectionsInner client = this.inner(); + return client.enableAsync(resourceGroupName, jobCollectionName).toCompletable(); + } + + @Override + public Completable disableAsync(String resourceGroupName, String jobCollectionName) { + JobCollectionsInner client = this.inner(); + return client.disableAsync(resourceGroupName, jobCollectionName).toCompletable(); + } + + @Override + protected JobCollectionDefinitionImpl wrapModel(JobCollectionDefinitionInner inner) { + return new JobCollectionDefinitionImpl(inner.name(), inner, manager()); + } + + @Override + protected JobCollectionDefinitionImpl wrapModel(String name) { + return new JobCollectionDefinitionImpl(name, new JobCollectionDefinitionInner(), this.manager()); + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionsInner.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionsInner.java new file mode 100644 index 000000000000..7e5e88608ea9 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobCollectionsInner.java @@ -0,0 +1,1085 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in JobCollections. + */ +public class JobCollectionsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private JobCollectionsService service; + /** The service client containing this operation class. */ + private SchedulerManagementClientImpl client; + + /** + * Initializes an instance of JobCollectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobCollectionsInner(Retrofit retrofit, SchedulerManagementClientImpl client) { + this.service = retrofit.create(JobCollectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for JobCollections to be + * used by Retrofit to perform actually REST calls. + */ + interface JobCollectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Body JobCollectionDefinitionInner jobCollection, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}") + Observable> patch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Body JobCollectionDefinitionInner jobCollection, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections enable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable") + Observable> enable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections disable" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable") + Observable> disable(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all job collections under specified subscription. + * + * @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 PagedList<JobCollectionDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all job collections under specified subscription. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all job collections under specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all job collections under specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all job collections under specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobCollectionDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all job collections under specified resource group. + * + * @param resourceGroupName The resource group name. + * @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 PagedList<JobCollectionDefinitionInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all job collections under specified resource group. + * + * @param resourceGroupName The resource group name. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all job collections under specified resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all job collections under specified resource group. + * + * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all job collections under specified resource group. + * + ServiceResponse> * @param resourceGroupName The resource group name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobCollectionDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 JobCollectionDefinitionInner object if successful. + */ + public JobCollectionDefinitionInner getByResourceGroup(String resourceGroupName, String jobCollectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobCollectionName).toBlocking().single().body(); + } + + /** + * Gets a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @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 getByResourceGroupAsync(String resourceGroupName, String jobCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobCollectionName), serviceCallback); + } + + /** + * Gets a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobCollectionDefinitionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String jobCollectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, jobCollectionName).map(new Func1, JobCollectionDefinitionInner>() { + @Override + public JobCollectionDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobCollectionDefinitionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String jobCollectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Provisions a new job collection or updates an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 JobCollectionDefinitionInner object if successful. + */ + public JobCollectionDefinitionInner createOrUpdate(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobCollection).toBlocking().single().body(); + } + + /** + * Provisions a new job collection or updates an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @param 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 createOrUpdateAsync(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobCollection), serviceCallback); + } + + /** + * Provisions a new job collection or updates an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobCollectionDefinitionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobCollection).map(new Func1, JobCollectionDefinitionInner>() { + @Override + public JobCollectionDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provisions a new job collection or updates an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobCollectionDefinitionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (jobCollection == null) { + throw new IllegalArgumentException("Parameter jobCollection is required and cannot be null."); + } + Validator.validate(jobCollection); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), jobCollection, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patches an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 JobCollectionDefinitionInner object if successful. + */ + public JobCollectionDefinitionInner patch(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) { + return patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobCollection).toBlocking().single().body(); + } + + /** + * Patches an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @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 patchAsync(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobCollection), serviceCallback); + } + + /** + * Patches an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobCollectionDefinitionInner object + */ + public Observable patchAsync(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) { + return patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobCollection).map(new Func1, JobCollectionDefinitionInner>() { + @Override + public JobCollectionDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches an existing job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobCollection The job collection definition. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobCollectionDefinitionInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, JobCollectionDefinitionInner jobCollection) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (jobCollection == null) { + throw new IllegalArgumentException("Parameter jobCollection is required and cannot be null."); + } + Validator.validate(jobCollection); + return service.patch(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), jobCollection, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String jobCollectionName) { + deleteWithServiceResponseAsync(resourceGroupName, jobCollectionName).toBlocking().single().body(); + } + + /** + * Deletes a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @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 deleteAsync(String resourceGroupName, String jobCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, jobCollectionName), serviceCallback); + } + + /** + * Deletes a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String jobCollectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, jobCollectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String jobCollectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Enables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enable(String resourceGroupName, String jobCollectionName) { + enableWithServiceResponseAsync(resourceGroupName, jobCollectionName).toBlocking().single().body(); + } + + /** + * Enables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @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 enableAsync(String resourceGroupName, String jobCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableWithServiceResponseAsync(resourceGroupName, jobCollectionName), serviceCallback); + } + + /** + * Enables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableAsync(String resourceGroupName, String jobCollectionName) { + return enableWithServiceResponseAsync(resourceGroupName, jobCollectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableWithServiceResponseAsync(String resourceGroupName, String jobCollectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.enable(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Disables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disable(String resourceGroupName, String jobCollectionName) { + disableWithServiceResponseAsync(resourceGroupName, jobCollectionName).toBlocking().single().body(); + } + + /** + * Disables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @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 disableAsync(String resourceGroupName, String jobCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableWithServiceResponseAsync(resourceGroupName, jobCollectionName), serviceCallback); + } + + /** + * Disables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableAsync(String resourceGroupName, String jobCollectionName) { + return disableWithServiceResponseAsync(resourceGroupName, jobCollectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables all of the jobs in the job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableWithServiceResponseAsync(String resourceGroupName, String jobCollectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.disable(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all job collections under specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<JobCollectionDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all job collections under specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all job collections under specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all job collections under specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all job collections under specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobCollectionDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all job collections under specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<JobCollectionDefinitionInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all job collections under specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all job collections under specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all job collections under specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobCollectionDefinitionInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets all job collections under specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobCollectionDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobDefinitionImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobDefinitionImpl.java new file mode 100644 index 000000000000..f20b972faf7c --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobDefinitionImpl.java @@ -0,0 +1,136 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobDefinition; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobProperties; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class JobDefinitionImpl extends CreatableUpdatableImpl implements JobDefinition, JobDefinition.Definition, JobDefinition.Update { + private final SchedulerManager manager; + private String resourceGroupName; + private String jobCollectionName; + private String jobName; + private JobProperties cproperties; + private JobProperties uproperties; + + JobDefinitionImpl(String name, SchedulerManager manager) { + super(name, new JobDefinitionInner()); + this.manager = manager; + // Set resource name + this.jobName = name; + // + this.cproperties = new JobProperties(); + this.uproperties = new JobProperties(); + } + + JobDefinitionImpl(JobDefinitionInner inner, SchedulerManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.jobName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.jobCollectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "jobCollections"); + this.jobName = IdParsingUtils.getValueFromIdByName(inner.id(), "jobs"); + // + this.cproperties = new JobProperties(); + this.uproperties = new JobProperties(); + } + + @Override + public SchedulerManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.jobCollectionName, this.jobName, this.cproperties) + .map(new Func1() { + @Override + public JobDefinitionInner call(JobDefinitionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.patchAsync(this.resourceGroupName, this.jobCollectionName, this.jobName, this.uproperties) + .map(new Func1() { + @Override + public JobDefinitionInner call(JobDefinitionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + JobsInner client = this.manager().inner().jobs(); + return client.getAsync(this.resourceGroupName, this.jobCollectionName, this.jobName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.cproperties = new JobProperties(); + this.uproperties = new JobProperties(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public JobProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public JobDefinitionImpl withExistingJobCollection(String resourceGroupName, String jobCollectionName) { + this.resourceGroupName = resourceGroupName; + this.jobCollectionName = jobCollectionName; + return this; + } + + @Override + public JobDefinitionImpl withProperties(JobProperties properties) { + if (isInCreateMode()) { + this.cproperties = properties; + } else { + this.uproperties = properties; + } + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobDefinitionInner.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobDefinitionInner.java new file mode 100644 index 000000000000..755969237798 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobDefinitionInner.java @@ -0,0 +1,89 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobDefinitionInner model. + */ +public class JobDefinitionInner { + /** + * Gets the job resource identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets the job resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets the job resource name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Gets or sets the job properties. + */ + @JsonProperty(value = "properties") + private JobProperties properties; + + /** + * Get gets the job resource identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get gets the job resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get gets the job resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get gets or sets the job properties. + * + * @return the properties value + */ + public JobProperties properties() { + return this.properties; + } + + /** + * Set gets or sets the job properties. + * + * @param properties the properties value to set + * @return the JobDefinitionInner object itself. + */ + public JobDefinitionInner withProperties(JobProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobHistoryDefinitionImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobHistoryDefinitionImpl.java new file mode 100644 index 000000000000..d46ac640ff71 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobHistoryDefinitionImpl.java @@ -0,0 +1,47 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobHistoryDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobHistoryDefinitionProperties; + +class JobHistoryDefinitionImpl extends WrapperImpl implements JobHistoryDefinition { + private final SchedulerManager manager; + JobHistoryDefinitionImpl(JobHistoryDefinitionInner inner, SchedulerManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SchedulerManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public JobHistoryDefinitionProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobHistoryDefinitionInner.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobHistoryDefinitionInner.java new file mode 100644 index 000000000000..24cb47bc9195 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobHistoryDefinitionInner.java @@ -0,0 +1,78 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobHistoryDefinitionProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The JobHistoryDefinitionInner model. + */ +public class JobHistoryDefinitionInner { + /** + * Gets the job history identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Gets the job history resource type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Gets the job history name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Gets or sets the job history properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private JobHistoryDefinitionProperties properties; + + /** + * Get gets the job history identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get gets the job history resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get gets the job history name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get gets or sets the job history properties. + * + * @return the properties value + */ + public JobHistoryDefinitionProperties properties() { + return this.properties; + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobsImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobsImpl.java new file mode 100644 index 000000000000..287fd0d2c185 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobsImpl.java @@ -0,0 +1,110 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobHistoryDefinition; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobDefinition; + +class JobsImpl extends WrapperImpl implements Jobs { + private final SchedulerManager manager; + + JobsImpl(SchedulerManager manager) { + super(manager.inner().jobs()); + this.manager = manager; + } + + public SchedulerManager manager() { + return this.manager; + } + + @Override + public JobDefinitionImpl define(String name) { + return wrapModel(name); + } + + private JobDefinitionImpl wrapModel(JobDefinitionInner inner) { + return new JobDefinitionImpl(inner, manager()); + } + + private JobDefinitionImpl wrapModel(String name) { + return new JobDefinitionImpl(name, this.manager()); + } + + @Override + public Completable runAsync(String resourceGroupName, String jobCollectionName, String jobName) { + JobsInner client = this.inner(); + return client.runAsync(resourceGroupName, jobCollectionName, jobName).toCompletable(); + } + + @Override + public Observable listJobHistoryAsync(final String resourceGroupName, final String jobCollectionName, final String jobName) { + JobsInner client = this.inner(); + return client.listJobHistoryAsync(resourceGroupName, jobCollectionName, jobName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public JobHistoryDefinition call(JobHistoryDefinitionInner inner) { + return new JobHistoryDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String jobCollectionName) { + JobsInner client = this.inner(); + return client.listAsync(resourceGroupName, jobCollectionName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public JobDefinition call(JobDefinitionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String jobCollectionName, String jobName) { + JobsInner client = this.inner(); + return client.getAsync(resourceGroupName, jobCollectionName, jobName) + .flatMap(new Func1>() { + @Override + public Observable call(JobDefinitionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((JobDefinition)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String jobCollectionName, String jobName) { + JobsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, jobCollectionName, jobName).toCompletable(); + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobsInner.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobsInner.java new file mode 100644 index 000000000000..6e8c4e009055 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/JobsInner.java @@ -0,0 +1,1513 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobProperties; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +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 JobsInner { + /** The Retrofit service to perform REST calls. */ + private JobsService service; + /** The service client containing this operation class. */ + private SchedulerManagementClientImpl client; + + /** + * Initializes an instance of JobsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public JobsInner(Retrofit retrofit, SchedulerManagementClientImpl 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.management.scheduler.v2014_08_01_preview.Jobs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body JobDefinitionInner job, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs patch" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}") + Observable> patch(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body JobDefinitionInner job, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs run" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run") + Observable> run(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Query("api-version") String apiVersion, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs listJobHistory" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history") + Observable> listJobHistory(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("jobCollectionName") String jobCollectionName, @Path("jobName") String jobName, @Query("api-version") String apiVersion, @Query("$top") Integer top, @Query("$skip") Integer skip, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs listJobHistoryNext" }) + @GET + Observable> listJobHistoryNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner get(String resourceGroupName, String jobCollectionName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).toBlocking().single().body(); + } + + /** + * Gets a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @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 resourceGroupName, String jobCollectionName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName), serviceCallback); + } + + /** + * Gets a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable getAsync(String resourceGroupName, String jobCollectionName, String jobName) { + return getWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner createOrUpdate(String resourceGroupName, String jobCollectionName, String jobName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).toBlocking().single().body(); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param 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 createOrUpdateAsync(String resourceGroupName, String jobCollectionName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName), serviceCallback); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String jobCollectionName, String jobName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final JobProperties properties = null; + JobDefinitionInner job = new JobDefinitionInner(); + job.withProperties(null); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), job, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner createOrUpdate(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, properties).toBlocking().single().body(); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @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 createOrUpdateAsync(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, properties), serviceCallback); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, properties).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provisions a new job or updates an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + JobDefinitionInner job = new JobDefinitionInner(); + job.withProperties(properties); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), job, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner patch(String resourceGroupName, String jobCollectionName, String jobName) { + return patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).toBlocking().single().body(); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @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 patchAsync(String resourceGroupName, String jobCollectionName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName), serviceCallback); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable patchAsync(String resourceGroupName, String jobCollectionName, String jobName) { + return patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final JobProperties properties = null; + JobDefinitionInner job = new JobDefinitionInner(); + job.withProperties(null); + return service.patch(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), job, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @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 JobDefinitionInner object if successful. + */ + public JobDefinitionInner patch(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties) { + return patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, properties).toBlocking().single().body(); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @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 patchAsync(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, properties), serviceCallback); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable patchAsync(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties) { + return patchWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, properties).map(new Func1, JobDefinitionInner>() { + @Override + public JobDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patches an existing job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param properties Gets or sets the job properties. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the JobDefinitionInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName, JobProperties properties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(properties); + JobDefinitionInner job = new JobDefinitionInner(); + job.withProperties(properties); + return service.patch(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), job, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patchDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String jobCollectionName, String jobName) { + deleteWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).toBlocking().single().body(); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @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 deleteAsync(String resourceGroupName, String jobCollectionName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName), serviceCallback); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String jobCollectionName, String jobName) { + return deleteWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Runs a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void run(String resourceGroupName, String jobCollectionName, String jobName) { + runWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).toBlocking().single().body(); + } + + /** + * Runs a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @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 runAsync(String resourceGroupName, String jobCollectionName, String jobName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(runWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName), serviceCallback); + } + + /** + * Runs a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable runAsync(String resourceGroupName, String jobCollectionName, String jobName) { + return runWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Runs a job. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> runWithServiceResponseAsync(String resourceGroupName, String jobCollectionName, String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.run(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = runDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse runDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 PagedList<JobDefinitionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String jobCollectionName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, jobCollectionName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @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 String resourceGroupName, final String jobCollectionName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, jobCollectionName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String jobCollectionName) { + return listWithServiceResponseAsync(resourceGroupName, jobCollectionName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String jobCollectionName) { + return listSinglePageAsync(resourceGroupName, jobCollectionName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String jobCollectionName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + final Integer skip = null; + final String filter = null; + return service.list(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), top, skip, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param top The number of jobs to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 PagedList<JobDefinitionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String jobCollectionName, final Integer top, final Integer skip, final String filter) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, jobCollectionName, top, skip, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param top The number of jobs to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @param 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 String resourceGroupName, final String jobCollectionName, final Integer top, final Integer skip, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, jobCollectionName, top, skip, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param top The number of jobs to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String jobCollectionName, final Integer top, final Integer skip, final String filter) { + return listWithServiceResponseAsync(resourceGroupName, jobCollectionName, top, skip, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param top The number of jobs to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String jobCollectionName, final Integer top, final Integer skip, final String filter) { + return listSinglePageAsync(resourceGroupName, jobCollectionName, top, skip, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + ServiceResponse> * @param resourceGroupName The resource group name. + ServiceResponse> * @param jobCollectionName The job collection name. + ServiceResponse> * @param top The number of jobs to request, in the of range [1..100]. + ServiceResponse> * @param skip The (0-based) index of the job history list from which to begin requesting entries. + ServiceResponse> * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String jobCollectionName, final Integer top, final Integer skip, final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, jobCollectionName, this.client.apiVersion(), top, skip, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 PagedList<JobHistoryDefinitionInner> object if successful. + */ + public PagedList listJobHistory(final String resourceGroupName, final String jobCollectionName, final String jobName) { + ServiceResponse> response = listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @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> listJobHistoryAsync(final String resourceGroupName, final String jobCollectionName, final String jobName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobHistoryDefinitionInner> object + */ + public Observable> listJobHistoryAsync(final String resourceGroupName, final String jobCollectionName, final String jobName) { + return listJobHistoryWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobHistoryDefinitionInner> object + */ + public Observable>> listJobHistoryWithServiceResponseAsync(final String resourceGroupName, final String jobCollectionName, final String jobName) { + return listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listJobHistoryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobHistoryDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listJobHistorySinglePageAsync(final String resourceGroupName, final String jobCollectionName, final String jobName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + final Integer skip = null; + final String filter = null; + return service.listJobHistory(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), top, skip, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listJobHistoryDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param top the number of job history to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws 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 PagedList<JobHistoryDefinitionInner> object if successful. + */ + public PagedList listJobHistory(final String resourceGroupName, final String jobCollectionName, final String jobName, final Integer top, final Integer skip, final String filter) { + ServiceResponse> response = listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param top the number of job history to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @param 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> listJobHistoryAsync(final String resourceGroupName, final String jobCollectionName, final String jobName, final Integer top, final Integer skip, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param top the number of job history to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobHistoryDefinitionInner> object + */ + public Observable> listJobHistoryAsync(final String resourceGroupName, final String jobCollectionName, final String jobName, final Integer top, final Integer skip, final String filter) { + return listJobHistoryWithServiceResponseAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists job history. + * + * @param resourceGroupName The resource group name. + * @param jobCollectionName The job collection name. + * @param jobName The job name. + * @param top the number of job history to request, in the of range [1..100]. + * @param skip The (0-based) index of the job history list from which to begin requesting entries. + * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobHistoryDefinitionInner> object + */ + public Observable>> listJobHistoryWithServiceResponseAsync(final String resourceGroupName, final String jobCollectionName, final String jobName, final Integer top, final Integer skip, final String filter) { + return listJobHistorySinglePageAsync(resourceGroupName, jobCollectionName, jobName, top, skip, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listJobHistoryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists job history. + * + ServiceResponse> * @param resourceGroupName The resource group name. + ServiceResponse> * @param jobCollectionName The job collection name. + ServiceResponse> * @param jobName The job name. + ServiceResponse> * @param top the number of job history to request, in the of range [1..100]. + ServiceResponse> * @param skip The (0-based) index of the job history list from which to begin requesting entries. + ServiceResponse> * @param filter The filter to apply on the job state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobHistoryDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listJobHistorySinglePageAsync(final String resourceGroupName, final String jobCollectionName, final String jobName, final Integer top, final Integer skip, final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (jobCollectionName == null) { + throw new IllegalArgumentException("Parameter jobCollectionName is required and cannot be null."); + } + if (jobName == null) { + throw new IllegalArgumentException("Parameter jobName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listJobHistory(this.client.subscriptionId(), resourceGroupName, jobCollectionName, jobName, this.client.apiVersion(), top, skip, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listJobHistoryDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listJobHistoryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<JobDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all jobs under the specified job collection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all jobs under the specified job collection. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists job history. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<JobHistoryDefinitionInner> object if successful. + */ + public PagedList listJobHistoryNext(final String nextPageLink) { + ServiceResponse> response = listJobHistoryNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists job history. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listJobHistoryNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listJobHistoryNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists job history. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobHistoryDefinitionInner> object + */ + public Observable> listJobHistoryNextAsync(final String nextPageLink) { + return listJobHistoryNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists job history. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<JobHistoryDefinitionInner> object + */ + public Observable>> listJobHistoryNextWithServiceResponseAsync(final String nextPageLink) { + return listJobHistoryNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listJobHistoryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists job history. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<JobHistoryDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listJobHistoryNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listJobHistoryNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listJobHistoryNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listJobHistoryNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/PageImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..4234027070c0 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/SchedulerManagementClientImpl.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/SchedulerManagementClientImpl.java new file mode 100644 index 000000000000..b1a3fdcf5c37 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/SchedulerManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the SchedulerManagementClientImpl class. + */ +public class SchedulerManagementClientImpl extends AzureServiceClient { + /** 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 subscription id. */ + private String subscriptionId; + + /** + * Gets The subscription id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription id. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public SchedulerManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version. */ + private String apiVersion; + + /** + * Gets The API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** 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 SchedulerManagementClientImpl 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 SchedulerManagementClientImpl 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 SchedulerManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The JobCollectionsInner object to access its operations. + */ + private JobCollectionsInner jobCollections; + + /** + * Gets the JobCollectionsInner object to access its operations. + * @return the JobCollectionsInner object. + */ + public JobCollectionsInner jobCollections() { + return this.jobCollections; + } + + /** + * The JobsInner object to access its operations. + */ + private JobsInner jobs; + + /** + * Gets the JobsInner object to access its operations. + * @return the JobsInner object. + */ + public JobsInner jobs() { + return this.jobs; + } + + /** + * Initializes an instance of SchedulerManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public SchedulerManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of SchedulerManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public SchedulerManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of SchedulerManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public SchedulerManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2014-08-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.jobCollections = new JobCollectionsInner(restClient().retrofit(), this); + this.jobs = new JobsInner(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, auto-generated)", super.userAgent(), "SchedulerManagementClient", "2014-08-01-preview"); + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/SchedulerManager.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/SchedulerManager.java new file mode 100644 index 000000000000..af61f8a2b0b3 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/SchedulerManager.java @@ -0,0 +1,111 @@ +/** + * 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.management.scheduler.v2014_08_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.JobCollections; +import com.microsoft.azure.management.scheduler.v2014_08_01_preview.Jobs; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Scheduler resource management. + */ +public final class SchedulerManager extends ManagerCore { + private JobCollections jobCollections; + private Jobs jobs; + /** + * Get a Configurable instance that can be used to create SchedulerManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new SchedulerManager.ConfigurableImpl(); + } + /** + * Creates an instance of SchedulerManager that exposes Scheduler resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the SchedulerManager + */ + public static SchedulerManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new SchedulerManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of SchedulerManager that exposes Scheduler resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the SchedulerManager + */ + public static SchedulerManager authenticate(RestClient restClient, String subscriptionId) { + return new SchedulerManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of SchedulerManager that exposes Scheduler management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Scheduler management API entry points that work across subscriptions + */ + SchedulerManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage JobCollections. + */ + public JobCollections jobCollections() { + if (this.jobCollections == null) { + this.jobCollections = new JobCollectionsImpl(this); + } + return this.jobCollections; + } + + /** + * @return Entry point to manage Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(this); + } + return this.jobs; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public SchedulerManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return SchedulerManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private SchedulerManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new SchedulerManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/package-info.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..acf104a4b323 --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the implementation classes for SchedulerManagementClient. + */ +package com.microsoft.azure.management.scheduler.v2014_08_01_preview.implementation; diff --git a/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/package-info.java b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/package-info.java new file mode 100644 index 000000000000..92406f91a6de --- /dev/null +++ b/sdk/scheduler/mgmt-v2014_08_01_preview/src/main/java/com/microsoft/azure/management/scheduler/v2014_08_01_preview/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the classes for SchedulerManagementClient. + */ +package com.microsoft.azure.management.scheduler.v2014_08_01_preview;