diff --git a/batch/resource-manager/v2017_09_01/pom.xml b/batch/resource-manager/v2017_09_01/pom.xml new file mode 100644 index 000000000000..884298fdebcd --- /dev/null +++ b/batch/resource-manager/v2017_09_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.batch.v2017_09_01 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-batch + 1.0.0-beta + jar + Microsoft Azure SDK for Batch Management + This package contains Microsoft Batch 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 + + + + + + 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/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AccountKeyType.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AccountKeyType.java new file mode 100644 index 000000000000..e4dd9f18dc65 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AccountKeyType.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccountKeyType. + */ +public enum AccountKeyType { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"); + + /** The actual serialized value for a AccountKeyType instance. */ + private String value; + + AccountKeyType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccountKeyType instance. + * + * @param value the serialized value to parse. + * @return the parsed AccountKeyType object, or null if unable to parse. + */ + @JsonCreator + public static AccountKeyType fromString(String value) { + AccountKeyType[] items = AccountKeyType.values(); + for (AccountKeyType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ActivateApplicationPackageParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ActivateApplicationPackageParameters.java new file mode 100644 index 000000000000..1abf97254588 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ActivateApplicationPackageParameters.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for an activating an application package. + */ +public class ActivateApplicationPackageParameters { + /** + * The format of the application package binary file. + */ + @JsonProperty(value = "format", required = true) + private String format; + + /** + * Get the format of the application package binary file. + * + * @return the format value + */ + public String format() { + return this.format; + } + + /** + * Set the format of the application package binary file. + * + * @param format the format value to set + * @return the ActivateApplicationPackageParameters object itself. + */ + public ActivateApplicationPackageParameters withFormat(String format) { + this.format = format; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AllocationState.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AllocationState.java new file mode 100644 index 000000000000..35507c2d994a --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AllocationState.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AllocationState. + */ +public enum AllocationState { + /** Enum value Steady. */ + STEADY("Steady"), + + /** Enum value Resizing. */ + RESIZING("Resizing"), + + /** Enum value Stopping. */ + STOPPING("Stopping"); + + /** The actual serialized value for a AllocationState instance. */ + private String value; + + AllocationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AllocationState instance. + * + * @param value the serialized value to parse. + * @return the parsed AllocationState object, or null if unable to parse. + */ + @JsonCreator + public static AllocationState fromString(String value) { + AllocationState[] items = AllocationState.values(); + for (AllocationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Application.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Application.java new file mode 100644 index 000000000000..01d168c447fa --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Application.java @@ -0,0 +1,48 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.ApplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchManager; +import java.util.List; + +/** + * Type representing Application. + */ +public interface Application extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the allowUpdates value. + */ + Boolean allowUpdates(); + + /** + * @return the defaultVersion value. + */ + String defaultVersion(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the packages value. + */ + List packages(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationCreateParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationCreateParameters.java new file mode 100644 index 000000000000..52b885fbc5e4 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationCreateParameters.java @@ -0,0 +1,70 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for adding an Application. + */ +public class ApplicationCreateParameters { + /** + * A value indicating whether packages within the application may be + * overwritten using the same version string. + */ + @JsonProperty(value = "allowUpdates") + private Boolean allowUpdates; + + /** + * The display name for the application. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get a value indicating whether packages within the application may be overwritten using the same version string. + * + * @return the allowUpdates value + */ + public Boolean allowUpdates() { + return this.allowUpdates; + } + + /** + * Set a value indicating whether packages within the application may be overwritten using the same version string. + * + * @param allowUpdates the allowUpdates value to set + * @return the ApplicationCreateParameters object itself. + */ + public ApplicationCreateParameters withAllowUpdates(Boolean allowUpdates) { + this.allowUpdates = allowUpdates; + return this; + } + + /** + * Get the display name for the application. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name for the application. + * + * @param displayName the displayName value to set + * @return the ApplicationCreateParameters object itself. + */ + public ApplicationCreateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackage.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackage.java new file mode 100644 index 000000000000..58ae2193d054 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackage.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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.ApplicationPackageInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchManager; +import org.joda.time.DateTime; + +/** + * Type representing ApplicationPackage. + */ +public interface ApplicationPackage extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the format value. + */ + String format(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastActivationTime value. + */ + DateTime lastActivationTime(); + + /** + * @return the state value. + */ + PackageState state(); + + /** + * @return the storageUrl value. + */ + String storageUrl(); + + /** + * @return the storageUrlExpiry value. + */ + DateTime storageUrlExpiry(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackageReference.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackageReference.java new file mode 100644 index 000000000000..fd8ee6224078 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackageReference.java @@ -0,0 +1,76 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Link to an application package inside the batch account. + */ +public class ApplicationPackageReference { + /** + * The ID of the application package to install. This must be inside the + * same batch account as the pool. This can either be a reference to a + * specific version or the default version if one exists. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The version of the application to deploy. If omitted, the default + * version is deployed. + * If this is omitted, and no default version is specified for this + * application, the request fails with the error code + * InvalidApplicationPackageReferences. If you are calling the REST API + * directly, the HTTP status code is 409. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the ApplicationPackageReference object itself. + */ + public ApplicationPackageReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get if this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set if this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. + * + * @param version the version value to set + * @return the ApplicationPackageReference object itself. + */ + public ApplicationPackageReference withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackages.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackages.java new file mode 100644 index 000000000000..5f6877a0b185 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationPackages.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.batch.v2017_09_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.ApplicationPackagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ApplicationPackages. + */ +public interface ApplicationPackages extends HasInner { + /** + * Activates the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to activate. + * @param format The format of the application package binary file. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable activateAsync(String resourceGroupName, String accountName, String applicationId, String version, String format); + + /** + * Creates an application package record. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String accountName, String applicationId, String version); + + /** + * Gets information about the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String applicationId, String version); + + /** + * Deletes an application package record and its associated binary file. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String applicationId, String version); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationUpdateParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationUpdateParameters.java new file mode 100644 index 000000000000..26d4f8215aa6 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ApplicationUpdateParameters.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for an update application request. + */ +public class ApplicationUpdateParameters { + /** + * A value indicating whether packages within the application may be + * overwritten using the same version string. + */ + @JsonProperty(value = "allowUpdates") + private Boolean allowUpdates; + + /** + * The package to use if a client requests the application but does not + * specify a version. + */ + @JsonProperty(value = "defaultVersion") + private String defaultVersion; + + /** + * The display name for the application. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get a value indicating whether packages within the application may be overwritten using the same version string. + * + * @return the allowUpdates value + */ + public Boolean allowUpdates() { + return this.allowUpdates; + } + + /** + * Set a value indicating whether packages within the application may be overwritten using the same version string. + * + * @param allowUpdates the allowUpdates value to set + * @return the ApplicationUpdateParameters object itself. + */ + public ApplicationUpdateParameters withAllowUpdates(Boolean allowUpdates) { + this.allowUpdates = allowUpdates; + return this; + } + + /** + * Get the package to use if a client requests the application but does not specify a version. + * + * @return the defaultVersion value + */ + public String defaultVersion() { + return this.defaultVersion; + } + + /** + * Set the package to use if a client requests the application but does not specify a version. + * + * @param defaultVersion the defaultVersion value to set + * @return the ApplicationUpdateParameters object itself. + */ + public ApplicationUpdateParameters withDefaultVersion(String defaultVersion) { + this.defaultVersion = defaultVersion; + return this; + } + + /** + * Get the display name for the application. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name for the application. + * + * @param displayName the displayName value to set + * @return the ApplicationUpdateParameters object itself. + */ + public ApplicationUpdateParameters withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Applications.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Applications.java new file mode 100644 index 000000000000..054966d71d0d --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Applications.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.batch.v2017_09_01; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.ApplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Applications. + */ +public interface Applications extends HasInner { + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createAsync(String resourceGroupName, String accountName, String applicationId); + + /** + * Updates settings for the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable updateAsync(String resourceGroupName, String accountName, String applicationId, ApplicationUpdateParameters parameters); + + /** + * Gets information about the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String applicationId); + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes an application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String applicationId); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleRun.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleRun.java new file mode 100644 index 000000000000..5ca3a7f2e9cb --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleRun.java @@ -0,0 +1,100 @@ +/** + * 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.batch.v2017_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The results and errors from an execution of a pool autoscale formula. + */ +public class AutoScaleRun { + /** + * The time at which the autoscale formula was last evaluated. + */ + @JsonProperty(value = "evaluationTime", required = true) + private DateTime evaluationTime; + + /** + * The final values of all variables used in the evaluation of the + * autoscale formula. + * Each variable value is returned in the form $variable=value, and + * variables are separated by semicolons. + */ + @JsonProperty(value = "results") + private String results; + + /** + * Details of the error encountered evaluating the autoscale formula on the + * pool, if the evaluation was unsuccessful. + */ + @JsonProperty(value = "error") + private AutoScaleRunError error; + + /** + * Get the evaluationTime value. + * + * @return the evaluationTime value + */ + public DateTime evaluationTime() { + return this.evaluationTime; + } + + /** + * Set the evaluationTime value. + * + * @param evaluationTime the evaluationTime value to set + * @return the AutoScaleRun object itself. + */ + public AutoScaleRun withEvaluationTime(DateTime evaluationTime) { + this.evaluationTime = evaluationTime; + return this; + } + + /** + * Get each variable value is returned in the form $variable=value, and variables are separated by semicolons. + * + * @return the results value + */ + public String results() { + return this.results; + } + + /** + * Set each variable value is returned in the form $variable=value, and variables are separated by semicolons. + * + * @param results the results value to set + * @return the AutoScaleRun object itself. + */ + public AutoScaleRun withResults(String results) { + this.results = results; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public AutoScaleRunError error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the AutoScaleRun object itself. + */ + public AutoScaleRun withError(AutoScaleRunError error) { + this.error = error; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleRunError.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleRunError.java new file mode 100644 index 000000000000..8f7c55f792eb --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleRunError.java @@ -0,0 +1,98 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error that occurred when autoscaling a pool. + */ +public class AutoScaleRunError { + /** + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Additional details about the error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @param code the code value to set + * @return the AutoScaleRunError object itself. + */ + public AutoScaleRunError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a message describing the error, intended to be suitable for display in a user interface. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a message describing the error, intended to be suitable for display in a user interface. + * + * @param message the message value to set + * @return the AutoScaleRunError object itself. + */ + public AutoScaleRunError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the AutoScaleRunError object itself. + */ + public AutoScaleRunError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleSettings.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleSettings.java new file mode 100644 index 000000000000..695ced53b037 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoScaleSettings.java @@ -0,0 +1,72 @@ +/** + * 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.batch.v2017_09_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * AutoScale settings for the pool. + */ +public class AutoScaleSettings { + /** + * A formula for the desired number of compute nodes in the pool. + */ + @JsonProperty(value = "formula", required = true) + private String formula; + + /** + * The time interval at which to automatically adjust the pool size + * according to the autoscale formula. + * If omitted, the default value is 15 minutes (PT15M). + */ + @JsonProperty(value = "evaluationInterval") + private Period evaluationInterval; + + /** + * Get the formula value. + * + * @return the formula value + */ + public String formula() { + return this.formula; + } + + /** + * Set the formula value. + * + * @param formula the formula value to set + * @return the AutoScaleSettings object itself. + */ + public AutoScaleSettings withFormula(String formula) { + this.formula = formula; + return this; + } + + /** + * Get if omitted, the default value is 15 minutes (PT15M). + * + * @return the evaluationInterval value + */ + public Period evaluationInterval() { + return this.evaluationInterval; + } + + /** + * Set if omitted, the default value is 15 minutes (PT15M). + * + * @param evaluationInterval the evaluationInterval value to set + * @return the AutoScaleSettings object itself. + */ + public AutoScaleSettings withEvaluationInterval(Period evaluationInterval) { + this.evaluationInterval = evaluationInterval; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoStorageBaseProperties.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoStorageBaseProperties.java new file mode 100644 index 000000000000..7c0edd496ff9 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoStorageBaseProperties.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties related to the auto-storage account. + */ +public class AutoStorageBaseProperties { + /** + * The resource ID of the storage account to be used for auto-storage + * account. + */ + @JsonProperty(value = "storageAccountId", required = true) + private String storageAccountId; + + /** + * Get the resource ID of the storage account to be used for auto-storage account. + * + * @return the storageAccountId value + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the resource ID of the storage account to be used for auto-storage account. + * + * @param storageAccountId the storageAccountId value to set + * @return the AutoStorageBaseProperties object itself. + */ + public AutoStorageBaseProperties withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoStorageProperties.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoStorageProperties.java new file mode 100644 index 000000000000..ffe94d7d0dff --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoStorageProperties.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.batch.v2017_09_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about the auto-storage account associated with a Batch + * account. + */ +public class AutoStorageProperties extends AutoStorageBaseProperties { + /** + * The UTC time at which storage keys were last synchronized with the Batch + * account. + */ + @JsonProperty(value = "lastKeySync", required = true) + private DateTime lastKeySync; + + /** + * Get the UTC time at which storage keys were last synchronized with the Batch account. + * + * @return the lastKeySync value + */ + public DateTime lastKeySync() { + return this.lastKeySync; + } + + /** + * Set the UTC time at which storage keys were last synchronized with the Batch account. + * + * @param lastKeySync the lastKeySync value to set + * @return the AutoStorageProperties object itself. + */ + public AutoStorageProperties withLastKeySync(DateTime lastKeySync) { + this.lastKeySync = lastKeySync; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoUserScope.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoUserScope.java new file mode 100644 index 000000000000..6db5d2b650d8 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoUserScope.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AutoUserScope. + */ +public enum AutoUserScope { + /** Enum value Task. */ + TASK("Task"), + + /** Enum value Pool. */ + POOL("Pool"); + + /** The actual serialized value for a AutoUserScope instance. */ + private String value; + + AutoUserScope(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AutoUserScope instance. + * + * @param value the serialized value to parse. + * @return the parsed AutoUserScope object, or null if unable to parse. + */ + @JsonCreator + public static AutoUserScope fromString(String value) { + AutoUserScope[] items = AutoUserScope.values(); + for (AutoUserScope item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoUserSpecification.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoUserSpecification.java new file mode 100644 index 000000000000..8bc5de547693 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/AutoUserSpecification.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the parameters for the auto user that runs a task on the Batch + * service. + */ +public class AutoUserSpecification { + /** + * The scope for the auto user. + * pool - specifies that the task runs as the common auto user account + * which is created on every node in a pool. task - specifies that the + * service should create a new user for the task. The default value is + * task. Possible values include: 'Task', 'Pool'. + */ + @JsonProperty(value = "scope") + private AutoUserScope scope; + + /** + * The elevation level of the auto user. + * nonAdmin - The auto user is a standard user without elevated access. + * admin - The auto user is a user with elevated access and operates with + * full Administrator permissions. The default value is nonAdmin. Possible + * values include: 'NonAdmin', 'Admin'. + */ + @JsonProperty(value = "elevationLevel") + private ElevationLevel elevationLevel; + + /** + * Get pool - specifies that the task runs as the common auto user account which is created on every node in a pool. task - specifies that the service should create a new user for the task. The default value is task. Possible values include: 'Task', 'Pool'. + * + * @return the scope value + */ + public AutoUserScope scope() { + return this.scope; + } + + /** + * Set pool - specifies that the task runs as the common auto user account which is created on every node in a pool. task - specifies that the service should create a new user for the task. The default value is task. Possible values include: 'Task', 'Pool'. + * + * @param scope the scope value to set + * @return the AutoUserSpecification object itself. + */ + public AutoUserSpecification withScope(AutoUserScope scope) { + this.scope = scope; + return this; + } + + /** + * Get nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'. + * + * @return the elevationLevel value + */ + public ElevationLevel elevationLevel() { + return this.elevationLevel; + } + + /** + * Set nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'. + * + * @param elevationLevel the elevationLevel value to set + * @return the AutoUserSpecification object itself. + */ + public AutoUserSpecification withElevationLevel(ElevationLevel elevationLevel) { + this.elevationLevel = elevationLevel; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccount.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccount.java new file mode 100644 index 000000000000..855ad5908185 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccount.java @@ -0,0 +1,161 @@ +/** + * 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.batch.v2017_09_01; + +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.batch.v2017_09_01.implementation.BatchManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchAccountInner; + +/** + * Type representing BatchAccount. + */ +public interface BatchAccount extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the accountEndpoint value. + */ + String accountEndpoint(); + + /** + * @return the activeJobAndJobScheduleQuota value. + */ + int activeJobAndJobScheduleQuota(); + + /** + * @return the autoStorage value. + */ + AutoStorageProperties autoStorage(); + + /** + * @return the dedicatedCoreQuota value. + */ + int dedicatedCoreQuota(); + + /** + * @return the keyVaultReference value. + */ + KeyVaultReference keyVaultReference(); + + /** + * @return the lowPriorityCoreQuota value. + */ + int lowPriorityCoreQuota(); + + /** + * @return the poolAllocationMode value. + */ + PoolAllocationMode poolAllocationMode(); + + /** + * @return the poolQuota value. + */ + int poolQuota(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * The entirety of the BatchAccount definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of BatchAccount definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BatchAccount definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the BatchAccount definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the batchaccount definition allowing to specify AutoStorage. + */ + interface WithAutoStorage { + /** + * Specifies autoStorage. + * @param autoStorage The properties related to the auto-storage account + * @return the next definition stage + */ + WithCreate withAutoStorage(AutoStorageBaseProperties autoStorage); + } + + /** + * The stage of the batchaccount definition allowing to specify KeyVaultReference. + */ + interface WithKeyVaultReference { + /** + * Specifies keyVaultReference. + * @param keyVaultReference A reference to the Azure key vault associated with the Batch account + * @return the next definition stage + */ + WithCreate withKeyVaultReference(KeyVaultReference keyVaultReference); + } + + /** + * The stage of the batchaccount definition allowing to specify PoolAllocationMode. + */ + interface WithPoolAllocationMode { + /** + * Specifies poolAllocationMode. + * @param poolAllocationMode The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Azure Active Directory. If the mode is UserSubscription, clients must use Azure Active Directory. The default is BatchService. Possible values include: 'BatchService', 'UserSubscription' + * @return the next definition stage + */ + WithCreate withPoolAllocationMode(PoolAllocationMode poolAllocationMode); + } + + /** + * 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.WithAutoStorage, DefinitionStages.WithKeyVaultReference, DefinitionStages.WithPoolAllocationMode { + } + } + /** + * The template for a BatchAccount update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAutoStorage { + } + + /** + * Grouping of BatchAccount update stages. + */ + interface UpdateStages { + /** + * The stage of the batchaccount update allowing to specify AutoStorage. + */ + interface WithAutoStorage { + /** + * Specifies autoStorage. + * @param autoStorage The properties related to the auto-storage account + * @return the next update stage + */ + Update withAutoStorage(AutoStorageBaseProperties autoStorage); + } + + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountCreateHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountCreateHeaders.java new file mode 100644 index 000000000000..11fad7df0b40 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountCreateHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class BatchAccountCreateHeaders { + /** + * The URL of the resource used to check the status of the asynchronous + * operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Suggested delay to check the status of the asynchronous operation. The + * value is an integer that specifies the delay in seconds. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the URL of the resource used to check the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the URL of the resource used to check the status of the asynchronous operation. + * + * @param location the location value to set + * @return the BatchAccountCreateHeaders object itself. + */ + public BatchAccountCreateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. + * + * @param retryAfter the retryAfter value to set + * @return the BatchAccountCreateHeaders object itself. + */ + public BatchAccountCreateHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountCreateParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountCreateParameters.java new file mode 100644 index 000000000000..dfe89901d7e6 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountCreateParameters.java @@ -0,0 +1,156 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters supplied to the Create operation. + */ +@JsonFlatten +public class BatchAccountCreateParameters { + /** + * The region in which to create the account. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The user-specified tags associated with the account. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties related to the auto-storage account. + */ + @JsonProperty(value = "properties.autoStorage") + private AutoStorageBaseProperties autoStorage; + + /** + * The allocation mode to use for creating pools in the Batch account. + * The pool allocation mode also affects how clients may authenticate to + * the Batch Service API. If the mode is BatchService, clients may + * authenticate using access keys or Azure Active Directory. If the mode is + * UserSubscription, clients must use Azure Active Directory. The default + * is BatchService. Possible values include: 'BatchService', + * 'UserSubscription'. + */ + @JsonProperty(value = "properties.poolAllocationMode") + private PoolAllocationMode poolAllocationMode; + + /** + * A reference to the Azure key vault associated with the Batch account. + */ + @JsonProperty(value = "properties.keyVaultReference") + private KeyVaultReference keyVaultReference; + + /** + * Get the region in which to create the account. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the region in which to create the account. + * + * @param location the location value to set + * @return the BatchAccountCreateParameters object itself. + */ + public BatchAccountCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the user-specified tags associated with the account. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the user-specified tags associated with the account. + * + * @param tags the tags value to set + * @return the BatchAccountCreateParameters object itself. + */ + public BatchAccountCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties related to the auto-storage account. + * + * @return the autoStorage value + */ + public AutoStorageBaseProperties autoStorage() { + return this.autoStorage; + } + + /** + * Set the properties related to the auto-storage account. + * + * @param autoStorage the autoStorage value to set + * @return the BatchAccountCreateParameters object itself. + */ + public BatchAccountCreateParameters withAutoStorage(AutoStorageBaseProperties autoStorage) { + this.autoStorage = autoStorage; + return this; + } + + /** + * Get the pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Azure Active Directory. If the mode is UserSubscription, clients must use Azure Active Directory. The default is BatchService. Possible values include: 'BatchService', 'UserSubscription'. + * + * @return the poolAllocationMode value + */ + public PoolAllocationMode poolAllocationMode() { + return this.poolAllocationMode; + } + + /** + * Set the pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Azure Active Directory. If the mode is UserSubscription, clients must use Azure Active Directory. The default is BatchService. Possible values include: 'BatchService', 'UserSubscription'. + * + * @param poolAllocationMode the poolAllocationMode value to set + * @return the BatchAccountCreateParameters object itself. + */ + public BatchAccountCreateParameters withPoolAllocationMode(PoolAllocationMode poolAllocationMode) { + this.poolAllocationMode = poolAllocationMode; + return this; + } + + /** + * Get a reference to the Azure key vault associated with the Batch account. + * + * @return the keyVaultReference value + */ + public KeyVaultReference keyVaultReference() { + return this.keyVaultReference; + } + + /** + * Set a reference to the Azure key vault associated with the Batch account. + * + * @param keyVaultReference the keyVaultReference value to set + * @return the BatchAccountCreateParameters object itself. + */ + public BatchAccountCreateParameters withKeyVaultReference(KeyVaultReference keyVaultReference) { + this.keyVaultReference = keyVaultReference; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountDeleteHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountDeleteHeaders.java new file mode 100644 index 000000000000..dfc436f1d07e --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountDeleteHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class BatchAccountDeleteHeaders { + /** + * The URL of the resource used to check the status of the asynchronous + * operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Suggested delay to check the status of the asynchronous operation. The + * value is an integer that specifies the delay in seconds. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the URL of the resource used to check the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the URL of the resource used to check the status of the asynchronous operation. + * + * @param location the location value to set + * @return the BatchAccountDeleteHeaders object itself. + */ + public BatchAccountDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. + * + * @param retryAfter the retryAfter value to set + * @return the BatchAccountDeleteHeaders object itself. + */ + public BatchAccountDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountKeys.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountKeys.java new file mode 100644 index 000000000000..28744b954cdf --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountKeys.java @@ -0,0 +1,35 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchAccountKeysInner; + +/** + * Type representing BatchAccountKeys. + */ +public interface BatchAccountKeys extends HasInner, HasManager { + /** + * @return the accountName value. + */ + String accountName(); + + /** + * @return the primary value. + */ + String primary(); + + /** + * @return the secondary value. + */ + String secondary(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountRegenerateKeyParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountRegenerateKeyParameters.java new file mode 100644 index 000000000000..d66bd27c15ee --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountRegenerateKeyParameters.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters supplied to the RegenerateKey operation. + */ +public class BatchAccountRegenerateKeyParameters { + /** + * The type of account key to regenerate. Possible values include: + * 'Primary', 'Secondary'. + */ + @JsonProperty(value = "keyName", required = true) + private AccountKeyType keyName; + + /** + * Get the type of account key to regenerate. Possible values include: 'Primary', 'Secondary'. + * + * @return the keyName value + */ + public AccountKeyType keyName() { + return this.keyName; + } + + /** + * Set the type of account key to regenerate. Possible values include: 'Primary', 'Secondary'. + * + * @param keyName the keyName value to set + * @return the BatchAccountRegenerateKeyParameters object itself. + */ + public BatchAccountRegenerateKeyParameters withKeyName(AccountKeyType keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountUpdateParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountUpdateParameters.java new file mode 100644 index 000000000000..9505aa40ed21 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccountUpdateParameters.java @@ -0,0 +1,72 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Parameters for updating an Azure Batch account. + */ +@JsonFlatten +public class BatchAccountUpdateParameters { + /** + * The user-specified tags associated with the account. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The properties related to the auto-storage account. + */ + @JsonProperty(value = "properties.autoStorage") + private AutoStorageBaseProperties autoStorage; + + /** + * Get the user-specified tags associated with the account. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the user-specified tags associated with the account. + * + * @param tags the tags value to set + * @return the BatchAccountUpdateParameters object itself. + */ + public BatchAccountUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties related to the auto-storage account. + * + * @return the autoStorage value + */ + public AutoStorageBaseProperties autoStorage() { + return this.autoStorage; + } + + /** + * Set the properties related to the auto-storage account. + * + * @param autoStorage the autoStorage value to set + * @return the BatchAccountUpdateParameters object itself. + */ + public BatchAccountUpdateParameters withAutoStorage(AutoStorageBaseProperties autoStorage) { + this.autoStorage = autoStorage; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccounts.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccounts.java new file mode 100644 index 000000000000..e3220b32cc79 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchAccounts.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.batch.v2017_09_01; + +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.batch.v2017_09_01.implementation.BatchAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BatchAccounts. + */ +public interface BatchAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Synchronizes access keys for the auto-storage account configured for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName); + + /** + * Regenerates the specified account key for the Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName); + + /** + * Gets the account keys for the specified Batch account. + * This operation applies only to Batch accounts created with a poolAllocationMode of 'BatchService'. If the Batch account was created with a poolAllocationMode of 'UserSubscription', clients cannot use access to keys to authenticate, and must use Azure Active Directory instead. In this case, getting the keys will fail. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getKeysAsync(String resourceGroupName, String accountName); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchLocationQuota.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchLocationQuota.java new file mode 100644 index 000000000000..d92a78a9d057 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/BatchLocationQuota.java @@ -0,0 +1,25 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchLocationQuotaInner; + +/** + * Type representing BatchLocationQuota. + */ +public interface BatchLocationQuota extends HasInner, HasManager { + /** + * @return the accountQuota value. + */ + Integer accountQuota(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CachingType.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CachingType.java new file mode 100644 index 000000000000..1e083fa9cbc0 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CachingType.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CachingType. + */ +public enum CachingType { + /** Enum value None. */ + NONE("None"), + + /** Enum value ReadOnly. */ + READ_ONLY("ReadOnly"), + + /** Enum value ReadWrite. */ + READ_WRITE("ReadWrite"); + + /** The actual serialized value for a CachingType instance. */ + private String value; + + CachingType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CachingType instance. + * + * @param value the serialized value to parse. + * @return the parsed CachingType object, or null if unable to parse. + */ + @JsonCreator + public static CachingType fromString(String value) { + CachingType[] items = CachingType.values(); + for (CachingType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Certificate.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Certificate.java new file mode 100644 index 000000000000..b9c36cccafbe --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Certificate.java @@ -0,0 +1,283 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.CertificateInner; +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.batch.v2017_09_01.implementation.BatchManager; +import org.joda.time.DateTime; + +/** + * Type representing Certificate. + */ +public interface Certificate extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the deleteCertificateError value. + */ + DeleteCertificateError deleteCertificateError(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the format value. + */ + CertificateFormat format(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the previousProvisioningState value. + */ + CertificateProvisioningState previousProvisioningState(); + + /** + * @return the previousProvisioningStateTransitionTime value. + */ + DateTime previousProvisioningStateTransitionTime(); + + /** + * @return the provisioningState value. + */ + CertificateProvisioningState provisioningState(); + + /** + * @return the provisioningStateTransitionTime value. + */ + DateTime provisioningStateTransitionTime(); + + /** + * @return the publicData value. + */ + String publicData(); + + /** + * @return the thumbprint value. + */ + String thumbprint(); + + /** + * @return the thumbprintAlgorithm value. + */ + String thumbprintAlgorithm(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Certificate definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBatchAccount, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch, DefinitionStages.WithData, DefinitionStages.WithCreate { + } + + /** + * Grouping of Certificate definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Certificate definition. + */ + interface Blank extends WithBatchAccount { + } + + /** + * The stage of the certificate definition allowing to specify BatchAccount. + */ + interface WithBatchAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group that contains the Batch account + * @param accountName The name of the Batch account + * @return the next definition stage + */ + WithIfMatch withExistingBatchAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the certificate definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithIfNoneMatch withIfMatch(String ifMatch); + } + + /** + * The stage of the certificate definition allowing to specify IfNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies ifNoneMatch. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored + * @return the next definition stage + */ + WithData withIfNoneMatch(String ifNoneMatch); + } + + /** + * The stage of the certificate definition allowing to specify Data. + */ + interface WithData { + /** + * Specifies data. + * @param data The maximum size is 10KB + * @return the next definition stage + */ + WithCreate withData(String data); + } + + /** + * The stage of the certificate definition allowing to specify Format. + */ + interface WithFormat { + /** + * Specifies format. + * @param format The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer' + * @return the next definition stage + */ + WithCreate withFormat(CertificateFormat format); + } + + /** + * The stage of the certificate definition allowing to specify Password. + */ + interface WithPassword { + /** + * Specifies password. + * @param password This is required if the certificate format is pfx and must be omitted if the certificate format is cer + * @return the next definition stage + */ + WithCreate withPassword(String password); + } + + /** + * The stage of the certificate definition allowing to specify Thumbprint. + */ + interface WithThumbprint { + /** + * Specifies thumbprint. + * @param thumbprint This must match the thumbprint from the name + * @return the next definition stage + */ + WithCreate withThumbprint(String thumbprint); + } + + /** + * The stage of the certificate definition allowing to specify ThumbprintAlgorithm. + */ + interface WithThumbprintAlgorithm { + /** + * Specifies thumbprintAlgorithm. + * @param thumbprintAlgorithm This must match the first portion of the certificate name. Currently required to be 'SHA1' + * @return the next definition stage + */ + WithCreate withThumbprintAlgorithm(String thumbprintAlgorithm); + } + + /** + * 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, DefinitionStages.WithFormat, DefinitionStages.WithPassword, DefinitionStages.WithThumbprint, DefinitionStages.WithThumbprintAlgorithm { + } + } + /** + * The template for a Certificate update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithFormat, UpdateStages.WithPassword, UpdateStages.WithThumbprint, UpdateStages.WithThumbprintAlgorithm { + } + + /** + * Grouping of Certificate update stages. + */ + interface UpdateStages { + /** + * The stage of the certificate update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the certificate to update. This value can be omitted or set to "*" to apply the operation unconditionally + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the certificate update allowing to specify Format. + */ + interface WithFormat { + /** + * Specifies format. + * @param format The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer' + * @return the next update stage + */ + Update withFormat(CertificateFormat format); + } + + /** + * The stage of the certificate update allowing to specify Password. + */ + interface WithPassword { + /** + * Specifies password. + * @param password This is required if the certificate format is pfx and must be omitted if the certificate format is cer + * @return the next update stage + */ + Update withPassword(String password); + } + + /** + * The stage of the certificate update allowing to specify Thumbprint. + */ + interface WithThumbprint { + /** + * Specifies thumbprint. + * @param thumbprint This must match the thumbprint from the name + * @return the next update stage + */ + Update withThumbprint(String thumbprint); + } + + /** + * The stage of the certificate update allowing to specify ThumbprintAlgorithm. + */ + interface WithThumbprintAlgorithm { + /** + * Specifies thumbprintAlgorithm. + * @param thumbprintAlgorithm This must match the first portion of the certificate name. Currently required to be 'SHA1' + * @return the next update stage + */ + Update withThumbprintAlgorithm(String thumbprintAlgorithm); + } + + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateBaseProperties.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateBaseProperties.java new file mode 100644 index 000000000000..42c8a6eb72dc --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateBaseProperties.java @@ -0,0 +1,99 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CertificateBaseProperties model. + */ +public class CertificateBaseProperties { + /** + * The algorithm of the certificate thumbprint. + * This must match the first portion of the certificate name. Currently + * required to be 'SHA1'. + */ + @JsonProperty(value = "thumbprintAlgorithm") + private String thumbprintAlgorithm; + + /** + * The thumbprint of the certificate. + * This must match the thumbprint from the name. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * The format of the certificate - either Pfx or Cer. If omitted, the + * default is Pfx. Possible values include: 'Pfx', 'Cer'. + */ + @JsonProperty(value = "format") + private CertificateFormat format; + + /** + * Get this must match the first portion of the certificate name. Currently required to be 'SHA1'. + * + * @return the thumbprintAlgorithm value + */ + public String thumbprintAlgorithm() { + return this.thumbprintAlgorithm; + } + + /** + * Set this must match the first portion of the certificate name. Currently required to be 'SHA1'. + * + * @param thumbprintAlgorithm the thumbprintAlgorithm value to set + * @return the CertificateBaseProperties object itself. + */ + public CertificateBaseProperties withThumbprintAlgorithm(String thumbprintAlgorithm) { + this.thumbprintAlgorithm = thumbprintAlgorithm; + return this; + } + + /** + * Get this must match the thumbprint from the name. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set this must match the thumbprint from the name. + * + * @param thumbprint the thumbprint value to set + * @return the CertificateBaseProperties object itself. + */ + public CertificateBaseProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'. + * + * @return the format value + */ + public CertificateFormat format() { + return this.format; + } + + /** + * Set the format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'. + * + * @param format the format value to set + * @return the CertificateBaseProperties object itself. + */ + public CertificateBaseProperties withFormat(CertificateFormat format) { + this.format = format; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCancelDeletionHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCancelDeletionHeaders.java new file mode 100644 index 000000000000..ee0be6402d5e --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCancelDeletionHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for CancelDeletion operation. + */ +public class CertificateCancelDeletionHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the CertificateCancelDeletionHeaders object itself. + */ + public CertificateCancelDeletionHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCreateHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCreateHeaders.java new file mode 100644 index 000000000000..6c09e22e9ed4 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCreateHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class CertificateCreateHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the CertificateCreateHeaders object itself. + */ + public CertificateCreateHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCreateOrUpdateParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCreateOrUpdateParameters.java new file mode 100644 index 000000000000..edfc93d0d14c --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateCreateOrUpdateParameters.java @@ -0,0 +1,172 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Contains information about a certificate. + */ +@JsonFlatten +public class CertificateCreateOrUpdateParameters extends ProxyResource { + /** + * The algorithm of the certificate thumbprint. + * This must match the first portion of the certificate name. Currently + * required to be 'SHA1'. + */ + @JsonProperty(value = "properties.thumbprintAlgorithm") + private String thumbprintAlgorithm; + + /** + * The thumbprint of the certificate. + * This must match the thumbprint from the name. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The format of the certificate - either Pfx or Cer. If omitted, the + * default is Pfx. Possible values include: 'Pfx', 'Cer'. + */ + @JsonProperty(value = "properties.format") + private CertificateFormat format; + + /** + * The base64-encoded contents of the certificate. + * The maximum size is 10KB. + */ + @JsonProperty(value = "properties.data", required = true) + private String data; + + /** + * The password to access the certificate's private key. + * This is required if the certificate format is pfx and must be omitted if + * the certificate format is cer. + */ + @JsonProperty(value = "properties.password") + private String password; + + /** + * The ETag of the resource, used for concurrency statements. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get this must match the first portion of the certificate name. Currently required to be 'SHA1'. + * + * @return the thumbprintAlgorithm value + */ + public String thumbprintAlgorithm() { + return this.thumbprintAlgorithm; + } + + /** + * Set this must match the first portion of the certificate name. Currently required to be 'SHA1'. + * + * @param thumbprintAlgorithm the thumbprintAlgorithm value to set + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withThumbprintAlgorithm(String thumbprintAlgorithm) { + this.thumbprintAlgorithm = thumbprintAlgorithm; + return this; + } + + /** + * Get this must match the thumbprint from the name. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set this must match the thumbprint from the name. + * + * @param thumbprint the thumbprint value to set + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'. + * + * @return the format value + */ + public CertificateFormat format() { + return this.format; + } + + /** + * Set the format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'. + * + * @param format the format value to set + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withFormat(CertificateFormat format) { + this.format = format; + return this; + } + + /** + * Get the maximum size is 10KB. + * + * @return the data value + */ + public String data() { + return this.data; + } + + /** + * Set the maximum size is 10KB. + * + * @param data the data value to set + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withData(String data) { + this.data = data; + return this; + } + + /** + * Get this is required if the certificate format is pfx and must be omitted if the certificate format is cer. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set this is required if the certificate format is pfx and must be omitted if the certificate format is cer. + * + * @param password the password value to set + * @return the CertificateCreateOrUpdateParameters object itself. + */ + public CertificateCreateOrUpdateParameters withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the ETag of the resource, used for concurrency statements. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateDeleteHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateDeleteHeaders.java new file mode 100644 index 000000000000..a9c06eb4485b --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateDeleteHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class CertificateDeleteHeaders { + /** + * The URL of the resource used to check the status of the asynchronous + * operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Suggested delay to check the status of the asynchronous operation. The + * value is an integer that represents the seconds. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the URL of the resource used to check the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the URL of the resource used to check the status of the asynchronous operation. + * + * @param location the location value to set + * @return the CertificateDeleteHeaders object itself. + */ + public CertificateDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. + * + * @param retryAfter the retryAfter value to set + * @return the CertificateDeleteHeaders object itself. + */ + public CertificateDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateFormat.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateFormat.java new file mode 100644 index 000000000000..6724cd3b7008 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateFormat.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CertificateFormat. + */ +public enum CertificateFormat { + /** Enum value Pfx. */ + PFX("Pfx"), + + /** Enum value Cer. */ + CER("Cer"); + + /** The actual serialized value for a CertificateFormat instance. */ + private String value; + + CertificateFormat(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CertificateFormat instance. + * + * @param value the serialized value to parse. + * @return the parsed CertificateFormat object, or null if unable to parse. + */ + @JsonCreator + public static CertificateFormat fromString(String value) { + CertificateFormat[] items = CertificateFormat.values(); + for (CertificateFormat item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateGetHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateGetHeaders.java new file mode 100644 index 000000000000..643875d49392 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateGetHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Get operation. + */ +public class CertificateGetHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the CertificateGetHeaders object itself. + */ + public CertificateGetHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateProvisioningState.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateProvisioningState.java new file mode 100644 index 000000000000..6b76eea11aa9 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateProvisioningState.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CertificateProvisioningState. + */ +public enum CertificateProvisioningState { + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Failed. */ + FAILED("Failed"); + + /** The actual serialized value for a CertificateProvisioningState instance. */ + private String value; + + CertificateProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CertificateProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed CertificateProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static CertificateProvisioningState fromString(String value) { + CertificateProvisioningState[] items = CertificateProvisioningState.values(); + for (CertificateProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateReference.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateReference.java new file mode 100644 index 000000000000..6b43af8284c5 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateReference.java @@ -0,0 +1,159 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to a certificate to be installed on compute nodes in a pool. + * This must exist inside the same account as the pool. + */ +public class CertificateReference { + /** + * The fully qualified ID of the certificate to install on the pool. This + * must be inside the same batch account as the pool. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The location of the certificate store on the compute node into which to + * install the certificate. + * The default value is currentUser. This property is applicable only for + * pools configured with Windows nodes (that is, created with + * cloudServiceConfiguration, or with virtualMachineConfiguration using a + * Windows image reference). For Linux compute nodes, the certificates are + * stored in a directory inside the task working directory and an + * environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task + * to query for this location. For certificates with visibility of + * 'remoteUser', a 'certs' directory is created in the user's home + * directory (e.g., /home/{user-name}/certs) and certificates are placed in + * that directory. Possible values include: 'CurrentUser', 'LocalMachine'. + */ + @JsonProperty(value = "storeLocation") + private CertificateStoreLocation storeLocation; + + /** + * The name of the certificate store on the compute node into which to + * install the certificate. + * This property is applicable only for pools configured with Windows nodes + * (that is, created with cloudServiceConfiguration, or with + * virtualMachineConfiguration using a Windows image reference). Common + * store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, + * TrustedPublisher, AuthRoot, AddressBook, but any custom store name can + * also be used. The default value is My. + */ + @JsonProperty(value = "storeName") + private String storeName; + + /** + * Which user accounts on the compute node should have access to the + * private data of the certificate. + * Values are: + * + * starttask - The user account under which the start task is run. + * task - The accounts under which job tasks are run. + * remoteuser - The accounts under which users remotely access the node. + * + * You can specify more than one visibility in this collection. The default + * is all accounts. + */ + @JsonProperty(value = "visibility") + private List visibility; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the CertificateReference object itself. + */ + public CertificateReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine'. + * + * @return the storeLocation value + */ + public CertificateStoreLocation storeLocation() { + return this.storeLocation; + } + + /** + * Set the default value is currentUser. This property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. Possible values include: 'CurrentUser', 'LocalMachine'. + * + * @param storeLocation the storeLocation value to set + * @return the CertificateReference object itself. + */ + public CertificateReference withStoreLocation(CertificateStoreLocation storeLocation) { + this.storeLocation = storeLocation; + return this; + } + + /** + * Get this property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. + * + * @return the storeName value + */ + public String storeName() { + return this.storeName; + } + + /** + * Set this property is applicable only for pools configured with Windows nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. + * + * @param storeName the storeName value to set + * @return the CertificateReference object itself. + */ + public CertificateReference withStoreName(String storeName) { + this.storeName = storeName; + return this; + } + + /** + * Get values are: + starttask - The user account under which the start task is run. + task - The accounts under which job tasks are run. + remoteuser - The accounts under which users remotely access the node. + You can specify more than one visibility in this collection. The default is all accounts. + * + * @return the visibility value + */ + public List visibility() { + return this.visibility; + } + + /** + * Set values are: + starttask - The user account under which the start task is run. + task - The accounts under which job tasks are run. + remoteuser - The accounts under which users remotely access the node. + You can specify more than one visibility in this collection. The default is all accounts. + * + * @param visibility the visibility value to set + * @return the CertificateReference object itself. + */ + public CertificateReference withVisibility(List visibility) { + this.visibility = visibility; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateStoreLocation.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateStoreLocation.java new file mode 100644 index 000000000000..1aec929b15f5 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateStoreLocation.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CertificateStoreLocation. + */ +public enum CertificateStoreLocation { + /** Enum value CurrentUser. */ + CURRENT_USER("CurrentUser"), + + /** Enum value LocalMachine. */ + LOCAL_MACHINE("LocalMachine"); + + /** The actual serialized value for a CertificateStoreLocation instance. */ + private String value; + + CertificateStoreLocation(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CertificateStoreLocation instance. + * + * @param value the serialized value to parse. + * @return the parsed CertificateStoreLocation object, or null if unable to parse. + */ + @JsonCreator + public static CertificateStoreLocation fromString(String value) { + CertificateStoreLocation[] items = CertificateStoreLocation.values(); + for (CertificateStoreLocation item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateUpdateHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateUpdateHeaders.java new file mode 100644 index 000000000000..21350eeee2ff --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateUpdateHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Update operation. + */ +public class CertificateUpdateHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the CertificateUpdateHeaders object itself. + */ + public CertificateUpdateHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateVisibility.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateVisibility.java new file mode 100644 index 000000000000..687ed3f2e57e --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CertificateVisibility.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CertificateVisibility. + */ +public enum CertificateVisibility { + /** Enum value StartTask. */ + START_TASK("StartTask"), + + /** Enum value Task. */ + TASK("Task"), + + /** Enum value RemoteUser. */ + REMOTE_USER("RemoteUser"); + + /** The actual serialized value for a CertificateVisibility instance. */ + private String value; + + CertificateVisibility(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CertificateVisibility instance. + * + * @param value the serialized value to parse. + * @return the parsed CertificateVisibility object, or null if unable to parse. + */ + @JsonCreator + public static CertificateVisibility fromString(String value) { + CertificateVisibility[] items = CertificateVisibility.values(); + for (CertificateVisibility item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Certificates.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Certificates.java new file mode 100644 index 000000000000..41f0079465de --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Certificates.java @@ -0,0 +1,65 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.CertificatesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Certificates. + */ +public interface Certificates extends SupportsCreating, HasInner { + /** + * Cancels a failed deletion of a certificate from the specified account. + * If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable cancelDeletionAsync(String resourceGroupName, String accountName, String certificateName); + + /** + * Gets information about the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String certificateName); + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBatchAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String certificateName); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CheckNameAvailabilityParameters.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CheckNameAvailabilityParameters.java new file mode 100644 index 000000000000..177d855cd233 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CheckNameAvailabilityParameters.java @@ -0,0 +1,77 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Parameters for a check name availability request. + */ +public class CheckNameAvailabilityParameters { + /** + * The name to check for availability. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type. Must be set to Microsoft.Batch/batchAccounts. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of CheckNameAvailabilityParameters class. + * @param name the name to check for availability. + */ + public CheckNameAvailabilityParameters() { + type = "Microsoft.Batch/batchAccounts"; + } + + /** + * Get the name to check for availability. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name to check for availability. + * + * @param name the name value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type. Must be set to Microsoft.Batch/batchAccounts. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type. Must be set to Microsoft.Batch/batchAccounts. + * + * @param type the type value to set + * @return the CheckNameAvailabilityParameters object itself. + */ + public CheckNameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CheckNameAvailabilityResult.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CheckNameAvailabilityResult.java new file mode 100644 index 000000000000..b34c2dba6ddf --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CheckNameAvailabilityResult.java @@ -0,0 +1,35 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.CheckNameAvailabilityResultInner; + +/** + * Type representing CheckNameAvailabilityResult. + */ +public interface CheckNameAvailabilityResult extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + NameAvailabilityReason reason(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CloudServiceConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CloudServiceConfiguration.java new file mode 100644 index 000000000000..ff6e65661376 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/CloudServiceConfiguration.java @@ -0,0 +1,112 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration for nodes in a pool based on the Azure Cloud Services + * platform. + */ +public class CloudServiceConfiguration { + /** + * The Azure Guest OS family to be installed on the virtual machines in the + * pool. + * Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 + * R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS + * Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, + * equivalent to Windows Server 2016. For more information, see Azure Guest + * OS Releases + * (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + */ + @JsonProperty(value = "osFamily", required = true) + private String osFamily; + + /** + * The Azure Guest OS version to be installed on the virtual machines in + * the pool. + * The default value is * which specifies the latest operating system + * version for the specified OS family. + */ + @JsonProperty(value = "targetOSVersion") + private String targetOSVersion; + + /** + * The Azure Guest OS Version currently installed on the virtual machines + * in the pool. + * This may differ from targetOSVersion if the pool state is Upgrading. In + * this case some virtual machines may be on the targetOSVersion and some + * may be on the currentOSVersion during the upgrade process. Once all + * virtual machines have upgraded, currentOSVersion is updated to be the + * same as targetOSVersion. + */ + @JsonProperty(value = "currentOSVersion") + private String currentOSVersion; + + /** + * Get possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + * + * @return the osFamily value + */ + public String osFamily() { + return this.osFamily; + } + + /** + * Set possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). + * + * @param osFamily the osFamily value to set + * @return the CloudServiceConfiguration object itself. + */ + public CloudServiceConfiguration withOsFamily(String osFamily) { + this.osFamily = osFamily; + return this; + } + + /** + * Get the default value is * which specifies the latest operating system version for the specified OS family. + * + * @return the targetOSVersion value + */ + public String targetOSVersion() { + return this.targetOSVersion; + } + + /** + * Set the default value is * which specifies the latest operating system version for the specified OS family. + * + * @param targetOSVersion the targetOSVersion value to set + * @return the CloudServiceConfiguration object itself. + */ + public CloudServiceConfiguration withTargetOSVersion(String targetOSVersion) { + this.targetOSVersion = targetOSVersion; + return this; + } + + /** + * Get this may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion. + * + * @return the currentOSVersion value + */ + public String currentOSVersion() { + return this.currentOSVersion; + } + + /** + * Set this may differ from targetOSVersion if the pool state is Upgrading. In this case some virtual machines may be on the targetOSVersion and some may be on the currentOSVersion during the upgrade process. Once all virtual machines have upgraded, currentOSVersion is updated to be the same as targetOSVersion. + * + * @param currentOSVersion the currentOSVersion value to set + * @return the CloudServiceConfiguration object itself. + */ + public CloudServiceConfiguration withCurrentOSVersion(String currentOSVersion) { + this.currentOSVersion = currentOSVersion; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ComputeNodeDeallocationOption.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ComputeNodeDeallocationOption.java new file mode 100644 index 000000000000..73efefa524bd --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ComputeNodeDeallocationOption.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ComputeNodeDeallocationOption. + */ +public enum ComputeNodeDeallocationOption { + /** Enum value Requeue. */ + REQUEUE("Requeue"), + + /** Enum value Terminate. */ + TERMINATE("Terminate"), + + /** Enum value TaskCompletion. */ + TASK_COMPLETION("TaskCompletion"), + + /** Enum value RetainedData. */ + RETAINED_DATA("RetainedData"); + + /** The actual serialized value for a ComputeNodeDeallocationOption instance. */ + private String value; + + ComputeNodeDeallocationOption(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ComputeNodeDeallocationOption instance. + * + * @param value the serialized value to parse. + * @return the parsed ComputeNodeDeallocationOption object, or null if unable to parse. + */ + @JsonCreator + public static ComputeNodeDeallocationOption fromString(String value) { + ComputeNodeDeallocationOption[] items = ComputeNodeDeallocationOption.values(); + for (ComputeNodeDeallocationOption item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ComputeNodeFillType.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ComputeNodeFillType.java new file mode 100644 index 000000000000..8675bfa6c44e --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ComputeNodeFillType.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ComputeNodeFillType. + */ +public enum ComputeNodeFillType { + /** Enum value Spread. */ + SPREAD("Spread"), + + /** Enum value Pack. */ + PACK("Pack"); + + /** The actual serialized value for a ComputeNodeFillType instance. */ + private String value; + + ComputeNodeFillType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ComputeNodeFillType instance. + * + * @param value the serialized value to parse. + * @return the parsed ComputeNodeFillType object, or null if unable to parse. + */ + @JsonCreator + public static ComputeNodeFillType fromString(String value) { + ComputeNodeFillType[] items = ComputeNodeFillType.values(); + for (ComputeNodeFillType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DataDisk.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DataDisk.java new file mode 100644 index 000000000000..179d16e300fa --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DataDisk.java @@ -0,0 +1,152 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Disk settings which will be used by the data disks associated to + * Compute Nodes in the pool. + */ +public class DataDisk { + /** + * The logical unit number. + * The lun is used to uniquely identify each data disk. If attaching + * multiple disks, each should have a distinct lun. + */ + @JsonProperty(value = "lun", required = true) + private int lun; + + /** + * The type of caching to be enabled for the data disks. + * Values are: + * + * none - The caching mode for the disk is not enabled. + * readOnly - The caching mode for the disk is read only. + * readWrite - The caching mode for the disk is read and write. + * + * The default value for caching is none. For information about the caching + * options see: + * https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + * Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + */ + @JsonProperty(value = "caching") + private CachingType caching; + + /** + * The initial disk size in GB when creating new data disk. + */ + @JsonProperty(value = "diskSizeGB", required = true) + private int diskSizeGB; + + /** + * The storage account type to be used for the data disk. + * If omitted, the default is "Standard_LRS". Values are: + * + * Standard_LRS - The data disk should use standard locally redundant + * storage. + * Premium_LRS - The data disk should use premium locally redundant + * storage. Possible values include: 'Standard_LRS', 'Premium_LRS'. + */ + @JsonProperty(value = "storageAccountType") + private StorageAccountType storageAccountType; + + /** + * Get the lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. + * + * @return the lun value + */ + public int lun() { + return this.lun; + } + + /** + * Set the lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. + * + * @param lun the lun value to set + * @return the DataDisk object itself. + */ + public DataDisk withLun(int lun) { + this.lun = lun; + return this; + } + + /** + * Get values are: + none - The caching mode for the disk is not enabled. + readOnly - The caching mode for the disk is read only. + readWrite - The caching mode for the disk is read and write. + The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + * + * @return the caching value + */ + public CachingType caching() { + return this.caching; + } + + /** + * Set values are: + none - The caching mode for the disk is not enabled. + readOnly - The caching mode for the disk is read only. + readWrite - The caching mode for the disk is read and write. + The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + * + * @param caching the caching value to set + * @return the DataDisk object itself. + */ + public DataDisk withCaching(CachingType caching) { + this.caching = caching; + return this; + } + + /** + * Get the diskSizeGB value. + * + * @return the diskSizeGB value + */ + public int diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB value. + * + * @param diskSizeGB the diskSizeGB value to set + * @return the DataDisk object itself. + */ + public DataDisk withDiskSizeGB(int diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get if omitted, the default is "Standard_LRS". Values are: + Standard_LRS - The data disk should use standard locally redundant storage. + Premium_LRS - The data disk should use premium locally redundant storage. Possible values include: 'Standard_LRS', 'Premium_LRS'. + * + * @return the storageAccountType value + */ + public StorageAccountType storageAccountType() { + return this.storageAccountType; + } + + /** + * Set if omitted, the default is "Standard_LRS". Values are: + Standard_LRS - The data disk should use standard locally redundant storage. + Premium_LRS - The data disk should use premium locally redundant storage. Possible values include: 'Standard_LRS', 'Premium_LRS'. + * + * @param storageAccountType the storageAccountType value to set + * @return the DataDisk object itself. + */ + public DataDisk withStorageAccountType(StorageAccountType storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DeleteCertificateError.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DeleteCertificateError.java new file mode 100644 index 000000000000..40f2147699f4 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DeleteCertificateError.java @@ -0,0 +1,125 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the Batch service. + */ +public class DeleteCertificateError { + /** + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * The target of the particular error. For example, the name of the + * property in error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * A list of additional details about the error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @param code the code value to set + * @return the DeleteCertificateError object itself. + */ + public DeleteCertificateError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a message describing the error, intended to be suitable for display in a user interface. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a message describing the error, intended to be suitable for display in a user interface. + * + * @param message the message value to set + * @return the DeleteCertificateError object itself. + */ + public DeleteCertificateError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target of the particular error. For example, the name of the property in error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the particular error. For example, the name of the property in error. + * + * @param target the target value to set + * @return the DeleteCertificateError object itself. + */ + public DeleteCertificateError withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get a list of additional details about the error. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set a list of additional details about the error. + * + * @param details the details value to set + * @return the DeleteCertificateError object itself. + */ + public DeleteCertificateError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DeploymentConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DeploymentConfiguration.java new file mode 100644 index 000000000000..d3b64030e424 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/DeploymentConfiguration.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Deployment configuration properties. + */ +public class DeploymentConfiguration { + /** + * The cloud service configuration for the pool. + * This property and virtualMachineConfiguration are mutually exclusive and + * one of the properties must be specified. This property cannot be + * specified if the Batch account was created with its poolAllocationMode + * property set to 'UserSubscription'. + */ + @JsonProperty(value = "cloudServiceConfiguration") + private CloudServiceConfiguration cloudServiceConfiguration; + + /** + * The virtual machine configuration for the pool. + * This property and cloudServiceConfiguration are mutually exclusive and + * one of the properties must be specified. + */ + @JsonProperty(value = "virtualMachineConfiguration") + private VirtualMachineConfiguration virtualMachineConfiguration; + + /** + * Get this property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. + * + * @return the cloudServiceConfiguration value + */ + public CloudServiceConfiguration cloudServiceConfiguration() { + return this.cloudServiceConfiguration; + } + + /** + * Set this property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch account was created with its poolAllocationMode property set to 'UserSubscription'. + * + * @param cloudServiceConfiguration the cloudServiceConfiguration value to set + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withCloudServiceConfiguration(CloudServiceConfiguration cloudServiceConfiguration) { + this.cloudServiceConfiguration = cloudServiceConfiguration; + return this; + } + + /** + * Get this property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. + * + * @return the virtualMachineConfiguration value + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set this property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withVirtualMachineConfiguration(VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ElevationLevel.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ElevationLevel.java new file mode 100644 index 000000000000..e5feb3670428 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ElevationLevel.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ElevationLevel. + */ +public enum ElevationLevel { + /** Enum value NonAdmin. */ + NON_ADMIN("NonAdmin"), + + /** Enum value Admin. */ + ADMIN("Admin"); + + /** The actual serialized value for a ElevationLevel instance. */ + private String value; + + ElevationLevel(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ElevationLevel instance. + * + * @param value the serialized value to parse. + * @return the parsed ElevationLevel object, or null if unable to parse. + */ + @JsonCreator + public static ElevationLevel fromString(String value) { + ElevationLevel[] items = ElevationLevel.values(); + for (ElevationLevel item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/EnvironmentSetting.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/EnvironmentSetting.java new file mode 100644 index 000000000000..3b202c80e99a --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/EnvironmentSetting.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An environment variable to be set on a task process. + */ +public class EnvironmentSetting { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the EnvironmentSetting object itself. + */ + public EnvironmentSetting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the EnvironmentSetting object itself. + */ + public EnvironmentSetting withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/FixedScaleSettings.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/FixedScaleSettings.java new file mode 100644 index 000000000000..f1b8ee4b98aa --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/FixedScaleSettings.java @@ -0,0 +1,134 @@ +/** + * 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.batch.v2017_09_01; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Fixed scale settings for the pool. + */ +public class FixedScaleSettings { + /** + * The timeout for allocation of compute nodes to the pool. + * The default value is 15 minutes. Timeout values use ISO 8601 format. For + * example, use PT10M for 10 minutes. The minimum value is 5 minutes. If + * you specify a value less than 5 minutes, the Batch service rejects the + * request with an error; if you are calling the REST API directly, the + * HTTP status code is 400 (Bad Request). + */ + @JsonProperty(value = "resizeTimeout") + private Period resizeTimeout; + + /** + * The desired number of dedicated compute nodes in the pool. + * At least one of targetDedicatedNodes, targetLowPriority nodes must be + * set. + */ + @JsonProperty(value = "targetDedicatedNodes") + private Integer targetDedicatedNodes; + + /** + * The desired number of low-priority compute nodes in the pool. + * At least one of targetDedicatedNodes, targetLowPriority nodes must be + * set. + */ + @JsonProperty(value = "targetLowPriorityNodes") + private Integer targetLowPriorityNodes; + + /** + * Determines what to do with a node and its running task(s) if the pool + * size is decreasing. + * If omitted, the default value is Requeue. Possible values include: + * 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'. + */ + @JsonProperty(value = "nodeDeallocationOption") + private ComputeNodeDeallocationOption nodeDeallocationOption; + + /** + * Get the default value is 15 minutes. Timeout values use ISO 8601 format. For example, use PT10M for 10 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the resizeTimeout value + */ + public Period resizeTimeout() { + return this.resizeTimeout; + } + + /** + * Set the default value is 15 minutes. Timeout values use ISO 8601 format. For example, use PT10M for 10 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param resizeTimeout the resizeTimeout value to set + * @return the FixedScaleSettings object itself. + */ + public FixedScaleSettings withResizeTimeout(Period resizeTimeout) { + this.resizeTimeout = resizeTimeout; + return this; + } + + /** + * Get at least one of targetDedicatedNodes, targetLowPriority nodes must be set. + * + * @return the targetDedicatedNodes value + */ + public Integer targetDedicatedNodes() { + return this.targetDedicatedNodes; + } + + /** + * Set at least one of targetDedicatedNodes, targetLowPriority nodes must be set. + * + * @param targetDedicatedNodes the targetDedicatedNodes value to set + * @return the FixedScaleSettings object itself. + */ + public FixedScaleSettings withTargetDedicatedNodes(Integer targetDedicatedNodes) { + this.targetDedicatedNodes = targetDedicatedNodes; + return this; + } + + /** + * Get at least one of targetDedicatedNodes, targetLowPriority nodes must be set. + * + * @return the targetLowPriorityNodes value + */ + public Integer targetLowPriorityNodes() { + return this.targetLowPriorityNodes; + } + + /** + * Set at least one of targetDedicatedNodes, targetLowPriority nodes must be set. + * + * @param targetLowPriorityNodes the targetLowPriorityNodes value to set + * @return the FixedScaleSettings object itself. + */ + public FixedScaleSettings withTargetLowPriorityNodes(Integer targetLowPriorityNodes) { + this.targetLowPriorityNodes = targetLowPriorityNodes; + return this; + } + + /** + * Get if omitted, the default value is Requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'. + * + * @return the nodeDeallocationOption value + */ + public ComputeNodeDeallocationOption nodeDeallocationOption() { + return this.nodeDeallocationOption; + } + + /** + * Set if omitted, the default value is Requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'. + * + * @param nodeDeallocationOption the nodeDeallocationOption value to set + * @return the FixedScaleSettings object itself. + */ + public FixedScaleSettings withNodeDeallocationOption(ComputeNodeDeallocationOption nodeDeallocationOption) { + this.nodeDeallocationOption = nodeDeallocationOption; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ImageReference.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ImageReference.java new file mode 100644 index 000000000000..85c6e4aca1f6 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ImageReference.java @@ -0,0 +1,163 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A reference to an Azure Virtual Machines Marketplace image or the Azure + * Image resource of a custom Virtual Machine. To get the list of all + * imageReferences verified by Azure Batch, see the 'List supported node agent + * SKUs' operation. + */ +public class ImageReference { + /** + * The publisher of the Azure Virtual Machines Marketplace image. + * For example, Canonical or MicrosoftWindowsServer. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /** + * The offer type of the Azure Virtual Machines Marketplace image. + * For example, UbuntuServer or WindowsServer. + */ + @JsonProperty(value = "offer") + private String offer; + + /** + * The SKU of the Azure Virtual Machines Marketplace image. + * For example, 14.04.0-LTS or 2012-R2-Datacenter. + */ + @JsonProperty(value = "sku") + private String sku; + + /** + * The version of the Azure Virtual Machines Marketplace image. + * A value of 'latest' can be specified to select the latest version of an + * image. If omitted, the default is 'latest'. + */ + @JsonProperty(value = "version") + private String version; + + /** + * The ARM resource identifier of the virtual machine image. Computes nodes + * of the pool will be created using this custom image. This is of the form + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}. + * This property is mutually exclusive with other properties. The virtual + * machine image must be in the same region and subscription as the Azure + * Batch account. For information about the firewall settings for Batch + * node agent to communicate with Batch service see + * https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration + * . + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get for example, Canonical or MicrosoftWindowsServer. + * + * @return the publisher value + */ + public String publisher() { + return this.publisher; + } + + /** + * Set for example, Canonical or MicrosoftWindowsServer. + * + * @param publisher the publisher value to set + * @return the ImageReference object itself. + */ + public ImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get for example, UbuntuServer or WindowsServer. + * + * @return the offer value + */ + public String offer() { + return this.offer; + } + + /** + * Set for example, UbuntuServer or WindowsServer. + * + * @param offer the offer value to set + * @return the ImageReference object itself. + */ + public ImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get for example, 14.04.0-LTS or 2012-R2-Datacenter. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Set for example, 14.04.0-LTS or 2012-R2-Datacenter. + * + * @param sku the sku value to set + * @return the ImageReference object itself. + */ + public ImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get a value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set a value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. + * + * @param version the version value to set + * @return the ImageReference object itself. + */ + public ImageReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get this property is mutually exclusive with other properties. The virtual machine image must be in the same region and subscription as the Azure Batch account. For information about the firewall settings for Batch node agent to communicate with Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration . + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set this property is mutually exclusive with other properties. The virtual machine image must be in the same region and subscription as the Azure Batch account. For information about the firewall settings for Batch node agent to communicate with Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration . + * + * @param id the id value to set + * @return the ImageReference object itself. + */ + public ImageReference withId(String id) { + this.id = id; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InboundEndpointProtocol.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InboundEndpointProtocol.java new file mode 100644 index 000000000000..1837ec7ffe0b --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InboundEndpointProtocol.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for InboundEndpointProtocol. + */ +public enum InboundEndpointProtocol { + /** Enum value TCP. */ + TCP("TCP"), + + /** Enum value UDP. */ + UDP("UDP"); + + /** The actual serialized value for a InboundEndpointProtocol instance. */ + private String value; + + InboundEndpointProtocol(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InboundEndpointProtocol instance. + * + * @param value the serialized value to parse. + * @return the parsed InboundEndpointProtocol object, or null if unable to parse. + */ + @JsonCreator + public static InboundEndpointProtocol fromString(String value) { + InboundEndpointProtocol[] items = InboundEndpointProtocol.values(); + for (InboundEndpointProtocol item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InboundNatPool.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InboundNatPool.java new file mode 100644 index 000000000000..bca8061cd50f --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InboundNatPool.java @@ -0,0 +1,202 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A inbound NAT pool that can be used to address specific ports on compute + * nodes in a Batch pool externally. + */ +public class InboundNatPool { + /** + * The name of the endpoint. + * The name must be unique within a Batch pool, can contain letters, + * numbers, underscores, periods, and hyphens. Names must start with a + * letter or number, must end with a letter, number, or underscore, and + * cannot exceed 77 characters. If any invalid values are provided the + * request fails with HTTP status code 400. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The protocol of the endpoint. + * Possible values include: 'TCP', 'UDP'. + */ + @JsonProperty(value = "protocol", required = true) + private InboundEndpointProtocol protocol; + + /** + * The port number on the compute node. + * This must be unique within a Batch pool. Acceptable values are between 1 + * and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If + * any reserved values are provided the request fails with HTTP status code + * 400. + */ + @JsonProperty(value = "backendPort", required = true) + private int backendPort; + + /** + * The first port number in the range of external ports that will be used + * to provide inbound access to the backendPort on individual compute + * nodes. + * Acceptable values range between 1 and 65534 except ports from 50000 to + * 55000 which are reserved. All ranges within a pool must be distinct and + * cannot overlap. If any reserved or overlapping values are provided the + * request fails with HTTP status code 400. + */ + @JsonProperty(value = "frontendPortRangeStart", required = true) + private int frontendPortRangeStart; + + /** + * The last port number in the range of external ports that will be used to + * provide inbound access to the backendPort on individual compute nodes. + * Acceptable values range between 1 and 65534 except ports from 50000 to + * 55000 which are reserved by the Batch service. All ranges within a pool + * must be distinct and cannot overlap. If any reserved or overlapping + * values are provided the request fails with HTTP status code 400. + */ + @JsonProperty(value = "frontendPortRangeEnd", required = true) + private int frontendPortRangeEnd; + + /** + * A list of network security group rules that will be applied to the + * endpoint. + * The maximum number of rules that can be specified across all the + * endpoints on a Batch pool is 25. If no network security group rules are + * specified, a default rule will be created to allow inbound access to the + * specified backendPort. If the maximum number of network security group + * rules is exceeded the request fails with HTTP status code 400. + */ + @JsonProperty(value = "networkSecurityGroupRules") + private List networkSecurityGroupRules; + + /** + * Get the name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. + * + * @param name the name value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withName(String name) { + this.name = name; + return this; + } + + /** + * Get possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public InboundEndpointProtocol protocol() { + return this.protocol; + } + + /** + * Set possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withProtocol(InboundEndpointProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get this must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + * + * @return the backendPort value + */ + public int backendPort() { + return this.backendPort; + } + + /** + * Set this must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + * + * @param backendPort the backendPort value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withBackendPort(int backendPort) { + this.backendPort = backendPort; + return this; + } + + /** + * Get acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + * + * @return the frontendPortRangeStart value + */ + public int frontendPortRangeStart() { + return this.frontendPortRangeStart; + } + + /** + * Set acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + * + * @param frontendPortRangeStart the frontendPortRangeStart value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeStart(int frontendPortRangeStart) { + this.frontendPortRangeStart = frontendPortRangeStart; + return this; + } + + /** + * Get acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + * + * @return the frontendPortRangeEnd value + */ + public int frontendPortRangeEnd() { + return this.frontendPortRangeEnd; + } + + /** + * Set acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. + * + * @param frontendPortRangeEnd the frontendPortRangeEnd value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withFrontendPortRangeEnd(int frontendPortRangeEnd) { + this.frontendPortRangeEnd = frontendPortRangeEnd; + return this; + } + + /** + * Get the maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. + * + * @return the networkSecurityGroupRules value + */ + public List networkSecurityGroupRules() { + return this.networkSecurityGroupRules; + } + + /** + * Set the maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. + * + * @param networkSecurityGroupRules the networkSecurityGroupRules value to set + * @return the InboundNatPool object itself. + */ + public InboundNatPool withNetworkSecurityGroupRules(List networkSecurityGroupRules) { + this.networkSecurityGroupRules = networkSecurityGroupRules; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InterNodeCommunicationState.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InterNodeCommunicationState.java new file mode 100644 index 000000000000..a76a24defb53 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/InterNodeCommunicationState.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for InterNodeCommunicationState. + */ +public enum InterNodeCommunicationState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a InterNodeCommunicationState instance. */ + private String value; + + InterNodeCommunicationState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InterNodeCommunicationState instance. + * + * @param value the serialized value to parse. + * @return the parsed InterNodeCommunicationState object, or null if unable to parse. + */ + @JsonCreator + public static InterNodeCommunicationState fromString(String value) { + InterNodeCommunicationState[] items = InterNodeCommunicationState.values(); + for (InterNodeCommunicationState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/KeyVaultReference.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/KeyVaultReference.java new file mode 100644 index 000000000000..087c2c632442 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/KeyVaultReference.java @@ -0,0 +1,70 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identifies the Azure key vault associated with a Batch account. + */ +public class KeyVaultReference { + /** + * The resource ID of the Azure key vault associated with the Batch + * account. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The URL of the Azure key vault associated with the Batch account. + */ + @JsonProperty(value = "url", required = true) + private String url; + + /** + * Get the resource ID of the Azure key vault associated with the Batch account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the Azure key vault associated with the Batch account. + * + * @param id the id value to set + * @return the KeyVaultReference object itself. + */ + public KeyVaultReference withId(String id) { + this.id = id; + return this; + } + + /** + * Get the URL of the Azure key vault associated with the Batch account. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the URL of the Azure key vault associated with the Batch account. + * + * @param url the url value to set + * @return the KeyVaultReference object itself. + */ + public KeyVaultReference withUrl(String url) { + this.url = url; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/LinuxUserConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/LinuxUserConfiguration.java new file mode 100644 index 000000000000..b10e156a0944 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/LinuxUserConfiguration.java @@ -0,0 +1,107 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties used to create a user account on a Linux node. + */ +public class LinuxUserConfiguration { + /** + * The user ID of the user account. + * The uid and gid properties must be specified together or not at all. If + * not specified the underlying operating system picks the uid. + */ + @JsonProperty(value = "uid") + private Integer uid; + + /** + * The group ID for the user account. + * The uid and gid properties must be specified together or not at all. If + * not specified the underlying operating system picks the gid. + */ + @JsonProperty(value = "gid") + private Integer gid; + + /** + * The SSH private key for the user account. + * The private key must not be password protected. The private key is used + * to automatically configure asymmetric-key based authentication for SSH + * between nodes in a Linux pool when the pool's + * enableInterNodeCommunication property is true (it is ignored if + * enableInterNodeCommunication is false). It does this by placing the key + * pair into the user's .ssh directory. If not specified, password-less SSH + * is not configured between nodes (no modification of the user's .ssh + * directory is done). + */ + @JsonProperty(value = "sshPrivateKey") + private String sshPrivateKey; + + /** + * Get the uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. + * + * @return the uid value + */ + public Integer uid() { + return this.uid; + } + + /** + * Set the uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. + * + * @param uid the uid value to set + * @return the LinuxUserConfiguration object itself. + */ + public LinuxUserConfiguration withUid(Integer uid) { + this.uid = uid; + return this; + } + + /** + * Get the uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. + * + * @return the gid value + */ + public Integer gid() { + return this.gid; + } + + /** + * Set the uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. + * + * @param gid the gid value to set + * @return the LinuxUserConfiguration object itself. + */ + public LinuxUserConfiguration withGid(Integer gid) { + this.gid = gid; + return this; + } + + /** + * Get the private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). + * + * @return the sshPrivateKey value + */ + public String sshPrivateKey() { + return this.sshPrivateKey; + } + + /** + * Set the private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). + * + * @param sshPrivateKey the sshPrivateKey value to set + * @return the LinuxUserConfiguration object itself. + */ + public LinuxUserConfiguration withSshPrivateKey(String sshPrivateKey) { + this.sshPrivateKey = sshPrivateKey; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Locations.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Locations.java new file mode 100644 index 000000000000..a1d10f0b9163 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Locations.java @@ -0,0 +1,36 @@ +/** + * 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.batch.v2017_09_01; + +import rx.Observable; + +/** + * Type representing Locations. + */ +public interface Locations { + /** + * Gets the Batch service quotas for the specified subscription at the given location. + * + * @param locationName The region for which to retrieve Batch service quotas. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getQuotasAsync(String locationName); + + /** + * Checks whether the Batch account name is available in the specified region. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String locationName, String name); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/MetadataItem.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/MetadataItem.java new file mode 100644 index 000000000000..b7c4484cf3f5 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/MetadataItem.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A name-value pair associated with a Batch service resource. + * The Batch service does not assign any meaning to this metadata; it is solely + * for the use of user code. + */ +public class MetadataItem { + /** + * The name of the metadata item. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the metadata item. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the MetadataItem object itself. + */ + public MetadataItem withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the MetadataItem object itself. + */ + public MetadataItem withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NameAvailabilityReason.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NameAvailabilityReason.java new file mode 100644 index 000000000000..84cd5ebe3e33 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NameAvailabilityReason.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NameAvailabilityReason. + */ +public enum NameAvailabilityReason { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value AlreadyExists. */ + ALREADY_EXISTS("AlreadyExists"); + + /** The actual serialized value for a NameAvailabilityReason instance. */ + private String value; + + NameAvailabilityReason(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NameAvailabilityReason instance. + * + * @param value the serialized value to parse. + * @return the parsed NameAvailabilityReason object, or null if unable to parse. + */ + @JsonCreator + public static NameAvailabilityReason fromString(String value) { + NameAvailabilityReason[] items = NameAvailabilityReason.values(); + for (NameAvailabilityReason item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkConfiguration.java new file mode 100644 index 000000000000..5e7475a4bdaf --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkConfiguration.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network configuration for a pool. + */ +public class NetworkConfiguration { + /** + * The ARM resource identifier of the virtual network subnet which the + * compute nodes of the pool will join. This is of the form + * /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. + * The virtual network must be in the same region and subscription as the + * Azure Batch account. The specified subnet should have enough free IP + * addresses to accommodate the number of nodes in the pool. If the subnet + * doesn't have enough free IP addresses, the pool will partially allocate + * compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' + * service principal must have the 'Classic Virtual Machine Contributor' + * Role-Based Access Control (RBAC) role for the specified VNet. The + * specified subnet must allow communication from the Azure Batch service + * to be able to schedule tasks on the compute nodes. This can be verified + * by checking if the specified VNet has any associated Network Security + * Groups (NSG). If communication to the compute nodes in the specified + * subnet is denied by an NSG, then the Batch service will set the state of + * the compute nodes to unusable. For pools created via + * virtualMachineConfiguration the Batch account must have + * poolAllocationMode userSubscription in order to use a VNet. If the + * specified VNet has any associated Network Security Groups (NSG), then a + * few reserved system ports must be enabled for inbound communication. For + * pools created with a virtual machine configuration, enable ports 29876 + * and 29877, as well as port 22 for Linux and port 3389 for Windows. For + * pools created with a cloud service configuration, enable ports 10100, + * 20100, and 30100. Also enable outbound connections to Azure Storage on + * port 443. For more details see: + * https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + */ + @JsonProperty(value = "subnetId") + private String subnetId; + + /** + * The configuration for endpoints on compute nodes in the Batch pool. + * Pool endpoint configuration is only supported on pools with the + * virtualMachineConfiguration property. + */ + @JsonProperty(value = "endpointConfiguration") + private PoolEndpointConfiguration endpointConfiguration; + + /** + * Get the virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created via virtualMachineConfiguration the Batch account must have poolAllocationMode userSubscription in order to use a VNet. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. For pools created via virtualMachineConfiguration the Batch account must have poolAllocationMode userSubscription in order to use a VNet. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For pools created with a virtual machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. For pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + * + * @param subnetId the subnetId value to set + * @return the NetworkConfiguration object itself. + */ + public NetworkConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. + * + * @return the endpointConfiguration value + */ + public PoolEndpointConfiguration endpointConfiguration() { + return this.endpointConfiguration; + } + + /** + * Set pool endpoint configuration is only supported on pools with the virtualMachineConfiguration property. + * + * @param endpointConfiguration the endpointConfiguration value to set + * @return the NetworkConfiguration object itself. + */ + public NetworkConfiguration withEndpointConfiguration(PoolEndpointConfiguration endpointConfiguration) { + this.endpointConfiguration = endpointConfiguration; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkSecurityGroupRule.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkSecurityGroupRule.java new file mode 100644 index 000000000000..de75d63fb9c5 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkSecurityGroupRule.java @@ -0,0 +1,107 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A network security group rule to apply to an inbound endpoint. + */ +public class NetworkSecurityGroupRule { + /** + * The priority for this rule. + * Priorities within a pool must be unique and are evaluated in order of + * priority. The lower the number the higher the priority. For example, + * rules could be specified with order numbers of 150, 250, and 350. The + * rule with the order number of 150 takes precedence over the rule that + * has an order of 250. Allowed priorities are 150 to 3500. If any reserved + * or duplicate values are provided the request fails with HTTP status code + * 400. + */ + @JsonProperty(value = "priority", required = true) + private int priority; + + /** + * The action that should be taken for a specified IP address, subnet range + * or tag. + * Possible values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "access", required = true) + private NetworkSecurityGroupRuleAccess access; + + /** + * The source address prefix or tag to match for the rule. + * Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. + * 192.168.1.0/24), default tag, or * (for all addresses). If any other + * values are provided the request fails with HTTP status code 400. + */ + @JsonProperty(value = "sourceAddressPrefix", required = true) + private String sourceAddressPrefix; + + /** + * Get priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400. + * + * @return the priority value + */ + public int priority() { + return this.priority; + } + + /** + * Set priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 3500. If any reserved or duplicate values are provided the request fails with HTTP status code 400. + * + * @param priority the priority value to set + * @return the NetworkSecurityGroupRule object itself. + */ + public NetworkSecurityGroupRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get possible values include: 'Allow', 'Deny'. + * + * @return the access value + */ + public NetworkSecurityGroupRuleAccess access() { + return this.access; + } + + /** + * Set possible values include: 'Allow', 'Deny'. + * + * @param access the access value to set + * @return the NetworkSecurityGroupRule object itself. + */ + public NetworkSecurityGroupRule withAccess(NetworkSecurityGroupRuleAccess access) { + this.access = access; + return this; + } + + /** + * Get valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. + * + * @return the sourceAddressPrefix value + */ + public String sourceAddressPrefix() { + return this.sourceAddressPrefix; + } + + /** + * Set valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. + * + * @param sourceAddressPrefix the sourceAddressPrefix value to set + * @return the NetworkSecurityGroupRule object itself. + */ + public NetworkSecurityGroupRule withSourceAddressPrefix(String sourceAddressPrefix) { + this.sourceAddressPrefix = sourceAddressPrefix; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkSecurityGroupRuleAccess.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkSecurityGroupRuleAccess.java new file mode 100644 index 000000000000..1a8ac59255f8 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/NetworkSecurityGroupRuleAccess.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for NetworkSecurityGroupRuleAccess. + */ +public enum NetworkSecurityGroupRuleAccess { + /** Enum value Allow. */ + ALLOW("Allow"), + + /** Enum value Deny. */ + DENY("Deny"); + + /** The actual serialized value for a NetworkSecurityGroupRuleAccess instance. */ + private String value; + + NetworkSecurityGroupRuleAccess(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a NetworkSecurityGroupRuleAccess instance. + * + * @param value the serialized value to parse. + * @return the parsed NetworkSecurityGroupRuleAccess object, or null if unable to parse. + */ + @JsonCreator + public static NetworkSecurityGroupRuleAccess fromString(String value) { + NetworkSecurityGroupRuleAccess[] items = NetworkSecurityGroupRuleAccess.values(); + for (NetworkSecurityGroupRuleAccess item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/OSDisk.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/OSDisk.java new file mode 100644 index 000000000000..13842dadae80 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/OSDisk.java @@ -0,0 +1,48 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings for the operating system disk of the virtual machine. + */ +public class OSDisk { + /** + * The type of caching to be enabled for the data disks. none - The caching + * mode for the disk is not enabled. readOnly - The caching mode for the + * disk is read only. readWrite - The caching mode for the disk is read and + * write. + * Default value is none. Possible values include: 'None', 'ReadOnly', + * 'ReadWrite'. + */ + @JsonProperty(value = "caching") + private CachingType caching; + + /** + * Get default value is none. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + * + * @return the caching value + */ + public CachingType caching() { + return this.caching; + } + + /** + * Set default value is none. Possible values include: 'None', 'ReadOnly', 'ReadWrite'. + * + * @param caching the caching value to set + * @return the OSDisk object itself. + */ + public OSDisk withCaching(CachingType caching) { + this.caching = caching; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Operation.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Operation.java new file mode 100644 index 000000000000..07c4513d01ae --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Operation.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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.BatchManager; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/OperationDisplay.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/OperationDisplay.java new file mode 100644 index 000000000000..7fb7823f60b1 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/OperationDisplay.java @@ -0,0 +1,122 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operation. + */ +public class OperationDisplay { + /** + * Friendly name of the resource provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The operation type. + * For example: read, write, delete, or listKeys/action. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get for example: read, write, delete, or listKeys/action. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set for example: read, write, delete, or listKeys/action. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Operations.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Operations.java new file mode 100644 index 000000000000..26a95e86f8ca --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Operations.java @@ -0,0 +1,27 @@ +/** + * 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.batch.v2017_09_01; + +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PackageState.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PackageState.java new file mode 100644 index 000000000000..e2406f983416 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PackageState.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PackageState. + */ +public enum PackageState { + /** Enum value Pending. */ + PENDING("Pending"), + + /** Enum value Active. */ + ACTIVE("Active"), + + /** Enum value Unmapped. */ + UNMAPPED("Unmapped"); + + /** The actual serialized value for a PackageState instance. */ + private String value; + + PackageState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PackageState instance. + * + * @param value the serialized value to parse. + * @return the parsed PackageState object, or null if unable to parse. + */ + @JsonCreator + public static PackageState fromString(String value) { + PackageState[] items = PackageState.values(); + for (PackageState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Pool.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Pool.java new file mode 100644 index 000000000000..6731a4dccc55 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Pool.java @@ -0,0 +1,587 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.PoolInner; +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.batch.v2017_09_01.implementation.BatchManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Pool. + */ +public interface Pool extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allocationState value. + */ + AllocationState allocationState(); + + /** + * @return the allocationStateTransitionTime value. + */ + DateTime allocationStateTransitionTime(); + + /** + * @return the applicationLicenses value. + */ + List applicationLicenses(); + + /** + * @return the applicationPackages value. + */ + List applicationPackages(); + + /** + * @return the autoScaleRun value. + */ + AutoScaleRun autoScaleRun(); + + /** + * @return the certificates value. + */ + List certificates(); + + /** + * @return the creationTime value. + */ + DateTime creationTime(); + + /** + * @return the currentDedicatedNodes value. + */ + Integer currentDedicatedNodes(); + + /** + * @return the currentLowPriorityNodes value. + */ + Integer currentLowPriorityNodes(); + + /** + * @return the deploymentConfiguration value. + */ + DeploymentConfiguration deploymentConfiguration(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the interNodeCommunication value. + */ + InterNodeCommunicationState interNodeCommunication(); + + /** + * @return the lastModified value. + */ + DateTime lastModified(); + + /** + * @return the maxTasksPerNode value. + */ + Integer maxTasksPerNode(); + + /** + * @return the metadata value. + */ + List metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the networkConfiguration value. + */ + NetworkConfiguration networkConfiguration(); + + /** + * @return the provisioningState value. + */ + PoolProvisioningState provisioningState(); + + /** + * @return the provisioningStateTransitionTime value. + */ + DateTime provisioningStateTransitionTime(); + + /** + * @return the resizeOperationStatus value. + */ + ResizeOperationStatus resizeOperationStatus(); + + /** + * @return the scaleSettings value. + */ + ScaleSettings scaleSettings(); + + /** + * @return the startTask value. + */ + StartTask startTask(); + + /** + * @return the taskSchedulingPolicy value. + */ + TaskSchedulingPolicy taskSchedulingPolicy(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the userAccounts value. + */ + List userAccounts(); + + /** + * @return the vmSize value. + */ + String vmSize(); + + /** + * The entirety of the Pool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBatchAccount, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch, DefinitionStages.WithCreate { + } + + /** + * Grouping of Pool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Pool definition. + */ + interface Blank extends WithBatchAccount { + } + + /** + * The stage of the pool definition allowing to specify BatchAccount. + */ + interface WithBatchAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group that contains the Batch account + * @param accountName The name of the Batch account + * @return the next definition stage + */ + WithIfMatch withExistingBatchAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the pool definition allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied + * @return the next definition stage + */ + WithIfNoneMatch withIfMatch(String ifMatch); + } + + /** + * The stage of the pool definition allowing to specify IfNoneMatch. + */ + interface WithIfNoneMatch { + /** + * Specifies ifNoneMatch. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored + * @return the next definition stage + */ + WithCreate withIfNoneMatch(String ifNoneMatch); + } + + /** + * The stage of the pool definition allowing to specify ApplicationLicenses. + */ + interface WithApplicationLicenses { + /** + * Specifies applicationLicenses. + * @param applicationLicenses The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail + * @return the next definition stage + */ + WithCreate withApplicationLicenses(List applicationLicenses); + } + + /** + * The stage of the pool definition allowing to specify ApplicationPackages. + */ + interface WithApplicationPackages { + /** + * Specifies applicationPackages. + * @param applicationPackages Changes to application packages affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged + * @return the next definition stage + */ + WithCreate withApplicationPackages(List applicationPackages); + } + + /** + * The stage of the pool definition allowing to specify Certificates. + */ + interface WithCertificates { + /** + * Specifies certificates. + * @param certificates For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory + * @return the next definition stage + */ + WithCreate withCertificates(List certificates); + } + + /** + * The stage of the pool definition allowing to specify DeploymentConfiguration. + */ + interface WithDeploymentConfiguration { + /** + * Specifies deploymentConfiguration. + * @param deploymentConfiguration Using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS), while VirtualMachineConfiguration uses Azure Virtual Machines (IaaS) + * @return the next definition stage + */ + WithCreate withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration); + } + + /** + * The stage of the pool definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024 + * @return the next definition stage + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the pool definition allowing to specify InterNodeCommunication. + */ + interface WithInterNodeCommunication { + /** + * Specifies interNodeCommunication. + * @param interNodeCommunication This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withInterNodeCommunication(InterNodeCommunicationState interNodeCommunication); + } + + /** + * The stage of the pool definition allowing to specify MaxTasksPerNode. + */ + interface WithMaxTasksPerNode { + /** + * Specifies maxTasksPerNode. + * @param maxTasksPerNode the maxTasksPerNode parameter value + * @return the next definition stage + */ + WithCreate withMaxTasksPerNode(Integer maxTasksPerNode); + } + + /** + * The stage of the pool definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata The Batch service does not assign any meaning to metadata; it is solely for the use of user code + * @return the next definition stage + */ + WithCreate withMetadata(List metadata); + } + + /** + * The stage of the pool definition allowing to specify NetworkConfiguration. + */ + interface WithNetworkConfiguration { + /** + * Specifies networkConfiguration. + * @param networkConfiguration the networkConfiguration parameter value + * @return the next definition stage + */ + WithCreate withNetworkConfiguration(NetworkConfiguration networkConfiguration); + } + + /** + * The stage of the pool definition allowing to specify ScaleSettings. + */ + interface WithScaleSettings { + /** + * Specifies scaleSettings. + * @param scaleSettings the scaleSettings parameter value + * @return the next definition stage + */ + WithCreate withScaleSettings(ScaleSettings scaleSettings); + } + + /** + * The stage of the pool definition allowing to specify StartTask. + */ + interface WithStartTask { + /** + * Specifies startTask. + * @param startTask In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool + * @return the next definition stage + */ + WithCreate withStartTask(StartTask startTask); + } + + /** + * The stage of the pool definition allowing to specify TaskSchedulingPolicy. + */ + interface WithTaskSchedulingPolicy { + /** + * Specifies taskSchedulingPolicy. + * @param taskSchedulingPolicy the taskSchedulingPolicy parameter value + * @return the next definition stage + */ + WithCreate withTaskSchedulingPolicy(TaskSchedulingPolicy taskSchedulingPolicy); + } + + /** + * The stage of the pool definition allowing to specify UserAccounts. + */ + interface WithUserAccounts { + /** + * Specifies userAccounts. + * @param userAccounts the userAccounts parameter value + * @return the next definition stage + */ + WithCreate withUserAccounts(List userAccounts); + } + + /** + * The stage of the pool definition allowing to specify VmSize. + */ + interface WithVmSize { + /** + * Specifies vmSize. + * @param vmSize For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series) + * @return the next definition stage + */ + WithCreate withVmSize(String vmSize); + } + + /** + * 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, DefinitionStages.WithApplicationLicenses, DefinitionStages.WithApplicationPackages, DefinitionStages.WithCertificates, DefinitionStages.WithDeploymentConfiguration, DefinitionStages.WithDisplayName, DefinitionStages.WithInterNodeCommunication, DefinitionStages.WithMaxTasksPerNode, DefinitionStages.WithMetadata, DefinitionStages.WithNetworkConfiguration, DefinitionStages.WithScaleSettings, DefinitionStages.WithStartTask, DefinitionStages.WithTaskSchedulingPolicy, DefinitionStages.WithUserAccounts, DefinitionStages.WithVmSize { + } + } + /** + * The template for a Pool update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIfMatch, UpdateStages.WithApplicationLicenses, UpdateStages.WithApplicationPackages, UpdateStages.WithCertificates, UpdateStages.WithDeploymentConfiguration, UpdateStages.WithDisplayName, UpdateStages.WithInterNodeCommunication, UpdateStages.WithMaxTasksPerNode, UpdateStages.WithMetadata, UpdateStages.WithNetworkConfiguration, UpdateStages.WithScaleSettings, UpdateStages.WithStartTask, UpdateStages.WithTaskSchedulingPolicy, UpdateStages.WithUserAccounts, UpdateStages.WithVmSize { + } + + /** + * Grouping of Pool update stages. + */ + interface UpdateStages { + /** + * The stage of the pool update allowing to specify IfMatch. + */ + interface WithIfMatch { + /** + * Specifies ifMatch. + * @param ifMatch The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally + * @return the next update stage + */ + Update withIfMatch(String ifMatch); + } + + /** + * The stage of the pool update allowing to specify ApplicationLicenses. + */ + interface WithApplicationLicenses { + /** + * Specifies applicationLicenses. + * @param applicationLicenses The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail + * @return the next update stage + */ + Update withApplicationLicenses(List applicationLicenses); + } + + /** + * The stage of the pool update allowing to specify ApplicationPackages. + */ + interface WithApplicationPackages { + /** + * Specifies applicationPackages. + * @param applicationPackages Changes to application packages affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged + * @return the next update stage + */ + Update withApplicationPackages(List applicationPackages); + } + + /** + * The stage of the pool update allowing to specify Certificates. + */ + interface WithCertificates { + /** + * Specifies certificates. + * @param certificates For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory + * @return the next update stage + */ + Update withCertificates(List certificates); + } + + /** + * The stage of the pool update allowing to specify DeploymentConfiguration. + */ + interface WithDeploymentConfiguration { + /** + * Specifies deploymentConfiguration. + * @param deploymentConfiguration Using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS), while VirtualMachineConfiguration uses Azure Virtual Machines (IaaS) + * @return the next update stage + */ + Update withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration); + } + + /** + * The stage of the pool update allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024 + * @return the next update stage + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the pool update allowing to specify InterNodeCommunication. + */ + interface WithInterNodeCommunication { + /** + * Specifies interNodeCommunication. + * @param interNodeCommunication This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withInterNodeCommunication(InterNodeCommunicationState interNodeCommunication); + } + + /** + * The stage of the pool update allowing to specify MaxTasksPerNode. + */ + interface WithMaxTasksPerNode { + /** + * Specifies maxTasksPerNode. + * @param maxTasksPerNode the maxTasksPerNode parameter value + * @return the next update stage + */ + Update withMaxTasksPerNode(Integer maxTasksPerNode); + } + + /** + * The stage of the pool update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata The Batch service does not assign any meaning to metadata; it is solely for the use of user code + * @return the next update stage + */ + Update withMetadata(List metadata); + } + + /** + * The stage of the pool update allowing to specify NetworkConfiguration. + */ + interface WithNetworkConfiguration { + /** + * Specifies networkConfiguration. + * @param networkConfiguration the networkConfiguration parameter value + * @return the next update stage + */ + Update withNetworkConfiguration(NetworkConfiguration networkConfiguration); + } + + /** + * The stage of the pool update allowing to specify ScaleSettings. + */ + interface WithScaleSettings { + /** + * Specifies scaleSettings. + * @param scaleSettings the scaleSettings parameter value + * @return the next update stage + */ + Update withScaleSettings(ScaleSettings scaleSettings); + } + + /** + * The stage of the pool update allowing to specify StartTask. + */ + interface WithStartTask { + /** + * Specifies startTask. + * @param startTask In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool + * @return the next update stage + */ + Update withStartTask(StartTask startTask); + } + + /** + * The stage of the pool update allowing to specify TaskSchedulingPolicy. + */ + interface WithTaskSchedulingPolicy { + /** + * Specifies taskSchedulingPolicy. + * @param taskSchedulingPolicy the taskSchedulingPolicy parameter value + * @return the next update stage + */ + Update withTaskSchedulingPolicy(TaskSchedulingPolicy taskSchedulingPolicy); + } + + /** + * The stage of the pool update allowing to specify UserAccounts. + */ + interface WithUserAccounts { + /** + * Specifies userAccounts. + * @param userAccounts the userAccounts parameter value + * @return the next update stage + */ + Update withUserAccounts(List userAccounts); + } + + /** + * The stage of the pool update allowing to specify VmSize. + */ + interface WithVmSize { + /** + * Specifies vmSize. + * @param vmSize For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series) + * @return the next update stage + */ + Update withVmSize(String vmSize); + } + + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolAllocationMode.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolAllocationMode.java new file mode 100644 index 000000000000..66724a3e2b04 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolAllocationMode.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PoolAllocationMode. + */ +public enum PoolAllocationMode { + /** Enum value BatchService. */ + BATCH_SERVICE("BatchService"), + + /** Enum value UserSubscription. */ + USER_SUBSCRIPTION("UserSubscription"); + + /** The actual serialized value for a PoolAllocationMode instance. */ + private String value; + + PoolAllocationMode(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PoolAllocationMode instance. + * + * @param value the serialized value to parse. + * @return the parsed PoolAllocationMode object, or null if unable to parse. + */ + @JsonCreator + public static PoolAllocationMode fromString(String value) { + PoolAllocationMode[] items = PoolAllocationMode.values(); + for (PoolAllocationMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolCreateHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolCreateHeaders.java new file mode 100644 index 000000000000..01af95609580 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolCreateHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Create operation. + */ +public class PoolCreateHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the PoolCreateHeaders object itself. + */ + public PoolCreateHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolDeleteHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolDeleteHeaders.java new file mode 100644 index 000000000000..c3911fd2410f --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolDeleteHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Delete operation. + */ +public class PoolDeleteHeaders { + /** + * The URL of the resource used to check the status of the asynchronous + * operation. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Suggested delay to check the status of the asynchronous operation. The + * value is an integer that represents the seconds. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the URL of the resource used to check the status of the asynchronous operation. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the URL of the resource used to check the status of the asynchronous operation. + * + * @param location the location value to set + * @return the PoolDeleteHeaders object itself. + */ + public PoolDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. + * + * @param retryAfter the retryAfter value to set + * @return the PoolDeleteHeaders object itself. + */ + public PoolDeleteHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolDisableAutoScaleHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolDisableAutoScaleHeaders.java new file mode 100644 index 000000000000..48da980f41b8 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolDisableAutoScaleHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for DisableAutoScale operation. + */ +public class PoolDisableAutoScaleHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the PoolDisableAutoScaleHeaders object itself. + */ + public PoolDisableAutoScaleHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolEndpointConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolEndpointConfiguration.java new file mode 100644 index 000000000000..456c88054ec4 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolEndpointConfiguration.java @@ -0,0 +1,48 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The endpoint configuration for a pool. + */ +public class PoolEndpointConfiguration { + /** + * A list of inbound NAT pools that can be used to address specific ports + * on an individual compute node externally. + * The maximum number of inbound NAT pools per Batch pool is 5. If the + * maximum number of inbound NAT pools is exceeded the request fails with + * HTTP status code 400. + */ + @JsonProperty(value = "inboundNatPools", required = true) + private List inboundNatPools; + + /** + * Get the maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. + * + * @return the inboundNatPools value + */ + public List inboundNatPools() { + return this.inboundNatPools; + } + + /** + * Set the maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. + * + * @param inboundNatPools the inboundNatPools value to set + * @return the PoolEndpointConfiguration object itself. + */ + public PoolEndpointConfiguration withInboundNatPools(List inboundNatPools) { + this.inboundNatPools = inboundNatPools; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolGetHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolGetHeaders.java new file mode 100644 index 000000000000..41f3ca2a4a01 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolGetHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Get operation. + */ +public class PoolGetHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the PoolGetHeaders object itself. + */ + public PoolGetHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolProvisioningState.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolProvisioningState.java new file mode 100644 index 000000000000..348de7f2e0cb --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolProvisioningState.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PoolProvisioningState. + */ +public enum PoolProvisioningState { + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Deleting. */ + DELETING("Deleting"); + + /** The actual serialized value for a PoolProvisioningState instance. */ + private String value; + + PoolProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PoolProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed PoolProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static PoolProvisioningState fromString(String value) { + PoolProvisioningState[] items = PoolProvisioningState.values(); + for (PoolProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolStopResizeHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolStopResizeHeaders.java new file mode 100644 index 000000000000..112fe2f9da01 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolStopResizeHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for StopResize operation. + */ +public class PoolStopResizeHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the PoolStopResizeHeaders object itself. + */ + public PoolStopResizeHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolUpdateHeaders.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolUpdateHeaders.java new file mode 100644 index 000000000000..93337b10b978 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/PoolUpdateHeaders.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Update operation. + */ +public class PoolUpdateHeaders { + /** + * The ETag HTTP response header. This is an opaque string. You can use it + * to detect whether the resource has changed between requests. In + * particular, you can pass the ETag to one of the If-Match or + * If-None-Match headers. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /** + * Get the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. + * + * @param eTag the eTag value to set + * @return the PoolUpdateHeaders object itself. + */ + public PoolUpdateHeaders withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Pools.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Pools.java new file mode 100644 index 000000000000..04a47763fe87 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/Pools.java @@ -0,0 +1,76 @@ +/** + * 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.batch.v2017_09_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.implementation.PoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Pools. + */ +public interface Pools extends SupportsCreating, HasInner { + /** + * Disables automatic scaling for a pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable disableAutoScaleAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Stops an ongoing resize operation on the pool. + * This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable stopResizeAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Gets information about the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String poolName); + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByBatchAccountAsync(final String resourceGroupName, final String accountName); + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String poolName); + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ProvisioningState.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ProvisioningState.java new file mode 100644 index 000000000000..4c6128212cb2 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ProvisioningState.java @@ -0,0 +1,65 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningState. + */ +public enum ProvisioningState { + /** Enum value Invalid. */ + INVALID("Invalid"), + + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Deleting. */ + DELETING("Deleting"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"), + + /** Enum value Failed. */ + FAILED("Failed"), + + /** Enum value Cancelled. */ + CANCELLED("Cancelled"); + + /** The actual serialized value for a ProvisioningState instance. */ + private String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResizeError.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResizeError.java new file mode 100644 index 000000000000..c0679146ad03 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResizeError.java @@ -0,0 +1,98 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error that occurred when resizing a pool. + */ +public class ResizeError { + /** + * An identifier for the error. Codes are invariant and are intended to be + * consumed programmatically. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * A message describing the error, intended to be suitable for display in a + * user interface. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Additional details about the error. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set an identifier for the error. Codes are invariant and are intended to be consumed programmatically. + * + * @param code the code value to set + * @return the ResizeError object itself. + */ + public ResizeError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get a message describing the error, intended to be suitable for display in a user interface. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a message describing the error, intended to be suitable for display in a user interface. + * + * @param message the message value to set + * @return the ResizeError object itself. + */ + public ResizeError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the ResizeError object itself. + */ + public ResizeError withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResizeOperationStatus.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResizeOperationStatus.java new file mode 100644 index 000000000000..46d09cdd7825 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResizeOperationStatus.java @@ -0,0 +1,190 @@ +/** + * 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.batch.v2017_09_01; + +import org.joda.time.Period; +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details about the current or last completed resize operation. + * Describes either the current operation (if the pool AllocationState is + * Resizing) or the previously completed operation (if the AllocationState is + * Steady). + */ +public class ResizeOperationStatus { + /** + * The desired number of dedicated compute nodes in the pool. + */ + @JsonProperty(value = "targetDedicatedNodes") + private Integer targetDedicatedNodes; + + /** + * The desired number of low-priority compute nodes in the pool. + */ + @JsonProperty(value = "targetLowPriorityNodes") + private Integer targetLowPriorityNodes; + + /** + * The timeout for allocation of compute nodes to the pool or removal of + * compute nodes from the pool. + * The default value is 15 minutes. The minimum value is 5 minutes. If you + * specify a value less than 5 minutes, the Batch service returns an error; + * if you are calling the REST API directly, the HTTP status code is 400 + * (Bad Request). + */ + @JsonProperty(value = "resizeTimeout") + private Period resizeTimeout; + + /** + * Determines what to do with a node and its running task(s) if the pool + * size is decreasing. + * The default value is requeue. Possible values include: 'Requeue', + * 'Terminate', 'TaskCompletion', 'RetainedData'. + */ + @JsonProperty(value = "nodeDeallocationOption") + private ComputeNodeDeallocationOption nodeDeallocationOption; + + /** + * The time when this resize operation was started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * Details of any errors encountered while performing the last resize on + * the pool. + * This property is set only if an error occurred during the last pool + * resize, and only when the pool allocationState is Steady. + */ + @JsonProperty(value = "errors") + private List errors; + + /** + * Get the targetDedicatedNodes value. + * + * @return the targetDedicatedNodes value + */ + public Integer targetDedicatedNodes() { + return this.targetDedicatedNodes; + } + + /** + * Set the targetDedicatedNodes value. + * + * @param targetDedicatedNodes the targetDedicatedNodes value to set + * @return the ResizeOperationStatus object itself. + */ + public ResizeOperationStatus withTargetDedicatedNodes(Integer targetDedicatedNodes) { + this.targetDedicatedNodes = targetDedicatedNodes; + return this; + } + + /** + * Get the targetLowPriorityNodes value. + * + * @return the targetLowPriorityNodes value + */ + public Integer targetLowPriorityNodes() { + return this.targetLowPriorityNodes; + } + + /** + * Set the targetLowPriorityNodes value. + * + * @param targetLowPriorityNodes the targetLowPriorityNodes value to set + * @return the ResizeOperationStatus object itself. + */ + public ResizeOperationStatus withTargetLowPriorityNodes(Integer targetLowPriorityNodes) { + this.targetLowPriorityNodes = targetLowPriorityNodes; + return this; + } + + /** + * Get the default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @return the resizeTimeout value + */ + public Period resizeTimeout() { + return this.resizeTimeout; + } + + /** + * Set the default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * @param resizeTimeout the resizeTimeout value to set + * @return the ResizeOperationStatus object itself. + */ + public ResizeOperationStatus withResizeTimeout(Period resizeTimeout) { + this.resizeTimeout = resizeTimeout; + return this; + } + + /** + * Get the default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'. + * + * @return the nodeDeallocationOption value + */ + public ComputeNodeDeallocationOption nodeDeallocationOption() { + return this.nodeDeallocationOption; + } + + /** + * Set the default value is requeue. Possible values include: 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData'. + * + * @param nodeDeallocationOption the nodeDeallocationOption value to set + * @return the ResizeOperationStatus object itself. + */ + public ResizeOperationStatus withNodeDeallocationOption(ComputeNodeDeallocationOption nodeDeallocationOption) { + this.nodeDeallocationOption = nodeDeallocationOption; + return this; + } + + /** + * Get the startTime value. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime value. + * + * @param startTime the startTime value to set + * @return the ResizeOperationStatus object itself. + */ + public ResizeOperationStatus withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get this property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set this property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. + * + * @param errors the errors value to set + * @return the ResizeOperationStatus object itself. + */ + public ResizeOperationStatus withErrors(List errors) { + this.errors = errors; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResourceFile.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResourceFile.java new file mode 100644 index 000000000000..7802ae680b78 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ResourceFile.java @@ -0,0 +1,106 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A file to be downloaded from Azure blob storage to a compute node. + */ +public class ResourceFile { + /** + * The URL of the file within Azure Blob Storage. + * This URL must be readable using anonymous access; that is, the Batch + * service does not present any credentials when downloading the blob. + * There are two ways to get such a URL for a blob in Azure storage: + * include a Shared Access Signature (SAS) granting read permissions on the + * blob, or set the ACL for the blob or its container to allow public + * access. + */ + @JsonProperty(value = "blobSource", required = true) + private String blobSource; + + /** + * The location on the compute node to which to download the file, relative + * to the task's working directory. + */ + @JsonProperty(value = "filePath", required = true) + private String filePath; + + /** + * The file permission mode attribute in octal format. + * This property applies only to files being downloaded to Linux compute + * nodes. It will be ignored if it is specified for a resourceFile which + * will be downloaded to a Windows node. If this property is not specified + * for a Linux node, then a default value of 0770 is applied to the file. + */ + @JsonProperty(value = "fileMode") + private String fileMode; + + /** + * Get this URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. + * + * @return the blobSource value + */ + public String blobSource() { + return this.blobSource; + } + + /** + * Set this URL must be readable using anonymous access; that is, the Batch service does not present any credentials when downloading the blob. There are two ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, or set the ACL for the blob or its container to allow public access. + * + * @param blobSource the blobSource value to set + * @return the ResourceFile object itself. + */ + public ResourceFile withBlobSource(String blobSource) { + this.blobSource = blobSource; + return this; + } + + /** + * Get the filePath value. + * + * @return the filePath value + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath value. + * + * @param filePath the filePath value to set + * @return the ResourceFile object itself. + */ + public ResourceFile withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get this property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. + * + * @return the fileMode value + */ + public String fileMode() { + return this.fileMode; + } + + /** + * Set this property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. + * + * @param fileMode the fileMode value to set + * @return the ResourceFile object itself. + */ + public ResourceFile withFileMode(String fileMode) { + this.fileMode = fileMode; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ScaleSettings.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ScaleSettings.java new file mode 100644 index 000000000000..171df4f23f75 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/ScaleSettings.java @@ -0,0 +1,77 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Scale settings for the pool. + * Defines the desired size of the pool. This can either be 'fixedScale' where + * the requested targetDedicatedNodes is specified, or 'autoScale' which + * defines a formula which is periodically reevaluated. If this property is not + * specified, the pool will have a fixed scale with 0 targetDedicatedNodes. + */ +public class ScaleSettings { + /** + * Fixed scale settings for the pool. + * This property and autoScale are mutually exclusive and one of the + * properties must be specified. + */ + @JsonProperty(value = "fixedScale") + private FixedScaleSettings fixedScale; + + /** + * AutoScale settings for the pool. + * This property and fixedScale are mutually exclusive and one of the + * properties must be specified. + */ + @JsonProperty(value = "autoScale") + private AutoScaleSettings autoScale; + + /** + * Get this property and autoScale are mutually exclusive and one of the properties must be specified. + * + * @return the fixedScale value + */ + public FixedScaleSettings fixedScale() { + return this.fixedScale; + } + + /** + * Set this property and autoScale are mutually exclusive and one of the properties must be specified. + * + * @param fixedScale the fixedScale value to set + * @return the ScaleSettings object itself. + */ + public ScaleSettings withFixedScale(FixedScaleSettings fixedScale) { + this.fixedScale = fixedScale; + return this; + } + + /** + * Get this property and fixedScale are mutually exclusive and one of the properties must be specified. + * + * @return the autoScale value + */ + public AutoScaleSettings autoScale() { + return this.autoScale; + } + + /** + * Set this property and fixedScale are mutually exclusive and one of the properties must be specified. + * + * @param autoScale the autoScale value to set + * @return the ScaleSettings object itself. + */ + public ScaleSettings withAutoScale(AutoScaleSettings autoScale) { + this.autoScale = autoScale; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/StartTask.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/StartTask.java new file mode 100644 index 000000000000..d84ab38f610d --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/StartTask.java @@ -0,0 +1,203 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A task which is run when a compute node joins a pool in the Azure Batch + * service, or when the compute node is rebooted or reimaged. + */ +public class StartTask { + /** + * The command line of the start task. + * The command line does not run under a shell, and therefore cannot take + * advantage of shell features such as environment variable expansion. If + * you want to take advantage of such features, you should invoke the shell + * in the command line, for example using "cmd /c MyCommand" in Windows or + * "/bin/sh -c MyCommand" in Linux. Required if any other properties of the + * startTask are specified. + */ + @JsonProperty(value = "commandLine") + private String commandLine; + + /** + * A list of files that the Batch service will download to the compute node + * before running the command line. + */ + @JsonProperty(value = "resourceFiles") + private List resourceFiles; + + /** + * A list of environment variable settings for the start task. + */ + @JsonProperty(value = "environmentSettings") + private List environmentSettings; + + /** + * The user identity under which the start task runs. + * If omitted, the task runs as a non-administrative user unique to the + * task. + */ + @JsonProperty(value = "userIdentity") + private UserIdentity userIdentity; + + /** + * The maximum number of times the task may be retried. + * The Batch service retries a task if its exit code is nonzero. Note that + * this value specifically controls the number of retries. The Batch + * service will try the task once, and may then retry up to this limit. For + * example, if the maximum retry count is 3, Batch tries the task up to 4 + * times (one initial try and 3 retries). If the maximum retry count is 0, + * the Batch service does not retry the task. If the maximum retry count is + * -1, the Batch service retries the task without limit. + */ + @JsonProperty(value = "maxTaskRetryCount") + private Integer maxTaskRetryCount; + + /** + * Whether the Batch service should wait for the start task to complete + * successfully (that is, to exit with exit code 0) before scheduling any + * tasks on the compute node. + * If true and the start task fails on a compute node, the Batch service + * retries the start task up to its maximum retry count + * (maxTaskRetryCount). If the task has still not completed successfully + * after all retries, then the Batch service marks the compute node + * unusable, and will not schedule tasks to it. This condition can be + * detected via the node state and scheduling error detail. If false, the + * Batch service will not wait for the start task to complete. In this + * case, other tasks can start executing on the compute node while the + * start task is still running; and even if the start task fails, new tasks + * will continue to be scheduled on the node. The default is false. + */ + @JsonProperty(value = "waitForSuccess") + private Boolean waitForSuccess; + + /** + * Get the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. Required if any other properties of the startTask are specified. + * + * @return the commandLine value + */ + public String commandLine() { + return this.commandLine; + } + + /** + * Set the command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. Required if any other properties of the startTask are specified. + * + * @param commandLine the commandLine value to set + * @return the StartTask object itself. + */ + public StartTask withCommandLine(String commandLine) { + this.commandLine = commandLine; + return this; + } + + /** + * Get the resourceFiles value. + * + * @return the resourceFiles value + */ + public List resourceFiles() { + return this.resourceFiles; + } + + /** + * Set the resourceFiles value. + * + * @param resourceFiles the resourceFiles value to set + * @return the StartTask object itself. + */ + public StartTask withResourceFiles(List resourceFiles) { + this.resourceFiles = resourceFiles; + return this; + } + + /** + * Get the environmentSettings value. + * + * @return the environmentSettings value + */ + public List environmentSettings() { + return this.environmentSettings; + } + + /** + * Set the environmentSettings value. + * + * @param environmentSettings the environmentSettings value to set + * @return the StartTask object itself. + */ + public StartTask withEnvironmentSettings(List environmentSettings) { + this.environmentSettings = environmentSettings; + return this; + } + + /** + * Get if omitted, the task runs as a non-administrative user unique to the task. + * + * @return the userIdentity value + */ + public UserIdentity userIdentity() { + return this.userIdentity; + } + + /** + * Set if omitted, the task runs as a non-administrative user unique to the task. + * + * @param userIdentity the userIdentity value to set + * @return the StartTask object itself. + */ + public StartTask withUserIdentity(UserIdentity userIdentity) { + this.userIdentity = userIdentity; + return this; + } + + /** + * Get the Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. + * + * @return the maxTaskRetryCount value + */ + public Integer maxTaskRetryCount() { + return this.maxTaskRetryCount; + } + + /** + * Set the Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. + * + * @param maxTaskRetryCount the maxTaskRetryCount value to set + * @return the StartTask object itself. + */ + public StartTask withMaxTaskRetryCount(Integer maxTaskRetryCount) { + this.maxTaskRetryCount = maxTaskRetryCount; + return this; + } + + /** + * Get if true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. + * + * @return the waitForSuccess value + */ + public Boolean waitForSuccess() { + return this.waitForSuccess; + } + + /** + * Set if true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. + * + * @param waitForSuccess the waitForSuccess value to set + * @return the StartTask object itself. + */ + public StartTask withWaitForSuccess(Boolean waitForSuccess) { + this.waitForSuccess = waitForSuccess; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/StorageAccountType.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/StorageAccountType.java new file mode 100644 index 000000000000..833dee6260d4 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/StorageAccountType.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for StorageAccountType. + */ +public enum StorageAccountType { + /** Enum value Standard_LRS. */ + STANDARD_LRS("Standard_LRS"), + + /** Enum value Premium_LRS. */ + PREMIUM_LRS("Premium_LRS"); + + /** The actual serialized value for a StorageAccountType instance. */ + private String value; + + StorageAccountType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a StorageAccountType instance. + * + * @param value the serialized value to parse. + * @return the parsed StorageAccountType object, or null if unable to parse. + */ + @JsonCreator + public static StorageAccountType fromString(String value) { + StorageAccountType[] items = StorageAccountType.values(); + for (StorageAccountType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/TaskSchedulingPolicy.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/TaskSchedulingPolicy.java new file mode 100644 index 000000000000..0d8279ab3c06 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/TaskSchedulingPolicy.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies how tasks should be distributed across compute nodes. + */ +public class TaskSchedulingPolicy { + /** + * How tasks should be distributed across compute nodes. + * Possible values include: 'Spread', 'Pack'. + */ + @JsonProperty(value = "nodeFillType", required = true) + private ComputeNodeFillType nodeFillType; + + /** + * Get possible values include: 'Spread', 'Pack'. + * + * @return the nodeFillType value + */ + public ComputeNodeFillType nodeFillType() { + return this.nodeFillType; + } + + /** + * Set possible values include: 'Spread', 'Pack'. + * + * @param nodeFillType the nodeFillType value to set + * @return the TaskSchedulingPolicy object itself. + */ + public TaskSchedulingPolicy withNodeFillType(ComputeNodeFillType nodeFillType) { + this.nodeFillType = nodeFillType; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/UserAccount.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/UserAccount.java new file mode 100644 index 000000000000..3d123dd45947 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/UserAccount.java @@ -0,0 +1,127 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties used to create a user on an Azure Batch node. + */ +public class UserAccount { + /** + * The name of the user account. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The password for the user account. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * The elevation level of the user account. + * nonAdmin - The auto user is a standard user without elevated access. + * admin - The auto user is a user with elevated access and operates with + * full Administrator permissions. The default value is nonAdmin. Possible + * values include: 'NonAdmin', 'Admin'. + */ + @JsonProperty(value = "elevationLevel") + private ElevationLevel elevationLevel; + + /** + * The Linux-specific user configuration for the user account. + * This property is ignored if specified on a Windows pool. If not + * specified, the user is created with the default options. + */ + @JsonProperty(value = "linuxUserConfiguration") + private LinuxUserConfiguration linuxUserConfiguration; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the UserAccount object itself. + */ + public UserAccount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password value. + * + * @param password the password value to set + * @return the UserAccount object itself. + */ + public UserAccount withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'. + * + * @return the elevationLevel value + */ + public ElevationLevel elevationLevel() { + return this.elevationLevel; + } + + /** + * Set nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. Possible values include: 'NonAdmin', 'Admin'. + * + * @param elevationLevel the elevationLevel value to set + * @return the UserAccount object itself. + */ + public UserAccount withElevationLevel(ElevationLevel elevationLevel) { + this.elevationLevel = elevationLevel; + return this; + } + + /** + * Get this property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. + * + * @return the linuxUserConfiguration value + */ + public LinuxUserConfiguration linuxUserConfiguration() { + return this.linuxUserConfiguration; + } + + /** + * Set this property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. + * + * @param linuxUserConfiguration the linuxUserConfiguration value to set + * @return the UserAccount object itself. + */ + public UserAccount withLinuxUserConfiguration(LinuxUserConfiguration linuxUserConfiguration) { + this.linuxUserConfiguration = linuxUserConfiguration; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/UserIdentity.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/UserIdentity.java new file mode 100644 index 000000000000..f17e19a40272 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/UserIdentity.java @@ -0,0 +1,74 @@ +/** + * 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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of the user identity under which the task is run. + * Specify either the userName or autoUser property, but not both. + */ +public class UserIdentity { + /** + * The name of the user identity under which the task is run. + * The userName and autoUser properties are mutually exclusive; you must + * specify one but not both. + */ + @JsonProperty(value = "userName") + private String userName; + + /** + * The auto user under which the task is run. + * The userName and autoUser properties are mutually exclusive; you must + * specify one but not both. + */ + @JsonProperty(value = "autoUser") + private AutoUserSpecification autoUser; + + /** + * Get the userName and autoUser properties are mutually exclusive; you must specify one but not both. + * + * @return the userName value + */ + public String userName() { + return this.userName; + } + + /** + * Set the userName and autoUser properties are mutually exclusive; you must specify one but not both. + * + * @param userName the userName value to set + * @return the UserIdentity object itself. + */ + public UserIdentity withUserName(String userName) { + this.userName = userName; + return this; + } + + /** + * Get the userName and autoUser properties are mutually exclusive; you must specify one but not both. + * + * @return the autoUser value + */ + public AutoUserSpecification autoUser() { + return this.autoUser; + } + + /** + * Set the userName and autoUser properties are mutually exclusive; you must specify one but not both. + * + * @param autoUser the autoUser value to set + * @return the UserIdentity object itself. + */ + public UserIdentity withAutoUser(AutoUserSpecification autoUser) { + this.autoUser = autoUser; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/VirtualMachineConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/VirtualMachineConfiguration.java new file mode 100644 index 000000000000..0b0aabb0aac5 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/VirtualMachineConfiguration.java @@ -0,0 +1,201 @@ +/** + * 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.batch.v2017_09_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration for compute nodes in a pool based on the Azure Virtual + * Machines infrastructure. + */ +public class VirtualMachineConfiguration { + /** + * A reference to the Azure Virtual Machines Marketplace Image or the + * custom Virtual Machine Image to use. + */ + @JsonProperty(value = "imageReference", required = true) + private ImageReference imageReference; + + /** + * Settings for the operating system disk of the Virtual Machine. + */ + @JsonProperty(value = "osDisk") + private OSDisk osDisk; + + /** + * The SKU of the Batch node agent to be provisioned on compute nodes in + * the pool. + * The Batch node agent is a program that runs on each node in the pool, + * and provides the command-and-control interface between the node and the + * Batch service. There are different implementations of the node agent, + * known as SKUs, for different operating systems. You must specify a node + * agent SKU which matches the selected image reference. To get the list of + * supported node agent SKUs along with their list of verified image + * references, see the 'List supported node agent SKUs' operation. + */ + @JsonProperty(value = "nodeAgentSkuId", required = true) + private String nodeAgentSkuId; + + /** + * Windows operating system settings on the virtual machine. + * This property must not be specified if the imageReference specifies a + * Linux OS image. + */ + @JsonProperty(value = "windowsConfiguration") + private WindowsConfiguration windowsConfiguration; + + /** + * The configuration for data disks attached to the compute nodes in the + * pool. + * This property must be specified if the compute nodes in the pool need to + * have empty data disks attached to them. + */ + @JsonProperty(value = "dataDisks") + private List dataDisks; + + /** + * The type of on-premises license to be used when deploying the operating + * system. + * This only applies to images that contain the Windows operating system, + * and should only be used when you hold valid on-premises licenses for the + * nodes which will be deployed. If omitted, no on-premises licensing + * discount is applied. Values are: + * + * Windows_Server - The on-premises license is for Windows Server. + * Windows_Client - The on-premises license is for Windows Client. + */ + @JsonProperty(value = "licenseType") + private String licenseType; + + /** + * Get the imageReference value. + * + * @return the imageReference value + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference value. + * + * @param imageReference the imageReference value to set + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osDisk value. + * + * @return the osDisk value + */ + public OSDisk osDisk() { + return this.osDisk; + } + + /** + * Set the osDisk value. + * + * @param osDisk the osDisk value to set + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withOsDisk(OSDisk osDisk) { + this.osDisk = osDisk; + return this; + } + + /** + * Get the Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. + * + * @return the nodeAgentSkuId value + */ + public String nodeAgentSkuId() { + return this.nodeAgentSkuId; + } + + /** + * Set the Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. + * + * @param nodeAgentSkuId the nodeAgentSkuId value to set + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withNodeAgentSkuId(String nodeAgentSkuId) { + this.nodeAgentSkuId = nodeAgentSkuId; + return this; + } + + /** + * Get this property must not be specified if the imageReference specifies a Linux OS image. + * + * @return the windowsConfiguration value + */ + public WindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set this property must not be specified if the imageReference specifies a Linux OS image. + * + * @param windowsConfiguration the windowsConfiguration value to set + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withWindowsConfiguration(WindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get this property must be specified if the compute nodes in the pool need to have empty data disks attached to them. + * + * @return the dataDisks value + */ + public List dataDisks() { + return this.dataDisks; + } + + /** + * Set this property must be specified if the compute nodes in the pool need to have empty data disks attached to them. + * + * @param dataDisks the dataDisks value to set + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withDataDisks(List dataDisks) { + this.dataDisks = dataDisks; + return this; + } + + /** + * Get this only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: + Windows_Server - The on-premises license is for Windows Server. + Windows_Client - The on-premises license is for Windows Client. + * + * @return the licenseType value + */ + public String licenseType() { + return this.licenseType; + } + + /** + * Set this only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: + Windows_Server - The on-premises license is for Windows Server. + Windows_Client - The on-premises license is for Windows Client. + * + * @param licenseType the licenseType value to set + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withLicenseType(String licenseType) { + this.licenseType = licenseType; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/WindowsConfiguration.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/WindowsConfiguration.java new file mode 100644 index 000000000000..44f191df0838 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/WindowsConfiguration.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.batch.v2017_09_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Windows operating system settings to apply to the virtual machine. + */ +public class WindowsConfiguration { + /** + * Whether automatic updates are enabled on the virtual machine. + * If omitted, the default value is true. + */ + @JsonProperty(value = "enableAutomaticUpdates") + private Boolean enableAutomaticUpdates; + + /** + * Get if omitted, the default value is true. + * + * @return the enableAutomaticUpdates value + */ + public Boolean enableAutomaticUpdates() { + return this.enableAutomaticUpdates; + } + + /** + * Set if omitted, the default value is true. + * + * @param enableAutomaticUpdates the enableAutomaticUpdates value to set + * @return the WindowsConfiguration object itself. + */ + public WindowsConfiguration withEnableAutomaticUpdates(Boolean enableAutomaticUpdates) { + this.enableAutomaticUpdates = enableAutomaticUpdates; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationImpl.java new file mode 100644 index 000000000000..175a451db22d --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationImpl.java @@ -0,0 +1,77 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.Application; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import java.util.ArrayList; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackage; +import java.util.List; + +class ApplicationImpl extends IndexableRefreshableWrapperImpl implements Application { + private final BatchManager manager; + private String resourceGroupName; + private String accountName; + private String applicationId; + + ApplicationImpl(ApplicationInner inner, BatchManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "batchAccounts"); + this.applicationId = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ApplicationsInner client = this.manager().inner().applications(); + return client.getAsync(this.resourceGroupName, this.accountName, this.applicationId); + } + + + + @Override + public Boolean allowUpdates() { + return this.inner().allowUpdates(); + } + + @Override + public String defaultVersion() { + return this.inner().defaultVersion(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public List packages() { + List lst = new ArrayList(); + if (this.inner().packages() != null) { + for (ApplicationPackageInner inner : this.inner().packages()) { + lst.add( new ApplicationPackageImpl(inner, manager())); + } + } + return lst; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationInner.java new file mode 100644 index 000000000000..2f6120f62cf5 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationInner.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.batch.v2017_09_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about an application in a Batch account. + */ +public class ApplicationInner { + /** + * A string that uniquely identifies the application within the account. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The display name for the application. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The list of packages under this application. + */ + @JsonProperty(value = "packages") + private List packages; + + /** + * A value indicating whether packages within the application may be + * overwritten using the same version string. + */ + @JsonProperty(value = "allowUpdates") + private Boolean allowUpdates; + + /** + * The package to use if a client requests the application but does not + * specify a version. + */ + @JsonProperty(value = "defaultVersion") + private String defaultVersion; + + /** + * Get a string that uniquely identifies the application within the account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set a string that uniquely identifies the application within the account. + * + * @param id the id value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the display name for the application. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name for the application. + * + * @param displayName the displayName value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the list of packages under this application. + * + * @return the packages value + */ + public List packages() { + return this.packages; + } + + /** + * Set the list of packages under this application. + * + * @param packages the packages value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withPackages(List packages) { + this.packages = packages; + return this; + } + + /** + * Get a value indicating whether packages within the application may be overwritten using the same version string. + * + * @return the allowUpdates value + */ + public Boolean allowUpdates() { + return this.allowUpdates; + } + + /** + * Set a value indicating whether packages within the application may be overwritten using the same version string. + * + * @param allowUpdates the allowUpdates value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withAllowUpdates(Boolean allowUpdates) { + this.allowUpdates = allowUpdates; + return this; + } + + /** + * Get the package to use if a client requests the application but does not specify a version. + * + * @return the defaultVersion value + */ + public String defaultVersion() { + return this.defaultVersion; + } + + /** + * Set the package to use if a client requests the application but does not specify a version. + * + * @param defaultVersion the defaultVersion value to set + * @return the ApplicationInner object itself. + */ + public ApplicationInner withDefaultVersion(String defaultVersion) { + this.defaultVersion = defaultVersion; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackageImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackageImpl.java new file mode 100644 index 000000000000..e1e2771021bc --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackageImpl.java @@ -0,0 +1,82 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackage; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.batch.v2017_09_01.PackageState; + +class ApplicationPackageImpl extends IndexableRefreshableWrapperImpl implements ApplicationPackage { + private final BatchManager manager; + private String resourceGroupName; + private String accountName; + private String applicationId; + private String version; + + ApplicationPackageImpl(ApplicationPackageInner inner, BatchManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "batchAccounts"); + this.applicationId = IdParsingUtils.getValueFromIdByName(inner.id(), "applications"); + this.version = IdParsingUtils.getValueFromIdByName(inner.id(), "versions"); + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ApplicationPackagesInner client = this.manager().inner().applicationPackages(); + return client.getAsync(this.resourceGroupName, this.accountName, this.applicationId, this.version); + } + + + + @Override + public String format() { + return this.inner().format(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime lastActivationTime() { + return this.inner().lastActivationTime(); + } + + @Override + public PackageState state() { + return this.inner().state(); + } + + @Override + public String storageUrl() { + return this.inner().storageUrl(); + } + + @Override + public DateTime storageUrlExpiry() { + return this.inner().storageUrlExpiry(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackageInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackageInner.java new file mode 100644 index 000000000000..3acec5f7e029 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackageInner.java @@ -0,0 +1,127 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.PackageState; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An application package which represents a particular version of an + * application. + */ +public class ApplicationPackageInner { + /** + * The ID of the application. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The version of the application package. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * The current state of the application package. Possible values include: + * 'Pending', 'Active', 'Unmapped'. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private PackageState state; + + /** + * The format of the application package, if the package is active. + */ + @JsonProperty(value = "format", access = JsonProperty.Access.WRITE_ONLY) + private String format; + + /** + * The URL for the application package in Azure Storage. + */ + @JsonProperty(value = "storageUrl", access = JsonProperty.Access.WRITE_ONLY) + private String storageUrl; + + /** + * The UTC time at which the Azure Storage URL will expire. + */ + @JsonProperty(value = "storageUrlExpiry", access = JsonProperty.Access.WRITE_ONLY) + private DateTime storageUrlExpiry; + + /** + * The time at which the package was last activated, if the package is + * active. + */ + @JsonProperty(value = "lastActivationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastActivationTime; + + /** + * Get the ID of the application. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the version of the application package. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get the current state of the application package. Possible values include: 'Pending', 'Active', 'Unmapped'. + * + * @return the state value + */ + public PackageState state() { + return this.state; + } + + /** + * Get the format of the application package, if the package is active. + * + * @return the format value + */ + public String format() { + return this.format; + } + + /** + * Get the URL for the application package in Azure Storage. + * + * @return the storageUrl value + */ + public String storageUrl() { + return this.storageUrl; + } + + /** + * Get the UTC time at which the Azure Storage URL will expire. + * + * @return the storageUrlExpiry value + */ + public DateTime storageUrlExpiry() { + return this.storageUrlExpiry; + } + + /** + * Get the time at which the package was last activated, if the package is active. + * + * @return the lastActivationTime value + */ + public DateTime lastActivationTime() { + return this.lastActivationTime; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackagesImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackagesImpl.java new file mode 100644 index 000000000000..56c361175fef --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackagesImpl.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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackages; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackage; + +class ApplicationPackagesImpl extends WrapperImpl implements ApplicationPackages { + private final BatchManager manager; + + ApplicationPackagesImpl(BatchManager manager) { + super(manager.inner().applicationPackages()); + this.manager = manager; + } + + public BatchManager manager() { + return this.manager; + } + + private ApplicationPackageImpl wrapModel(ApplicationPackageInner inner) { + return new ApplicationPackageImpl(inner, manager()); + } + + @Override + public Completable activateAsync(String resourceGroupName, String accountName, String applicationId, String version, String format) { + ApplicationPackagesInner client = this.inner(); + return client.activateAsync(resourceGroupName, accountName, applicationId, version, format).toCompletable(); + } + + @Override + public Observable createAsync(String resourceGroupName, String accountName, String applicationId, String version) { + ApplicationPackagesInner client = this.inner(); + return client.createAsync(resourceGroupName, accountName, applicationId, version) + .map(new Func1() { + @Override + public ApplicationPackage call(ApplicationPackageInner inner) { + return new ApplicationPackageImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String applicationId, String version) { + ApplicationPackagesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, applicationId, version) + .map(new Func1() { + @Override + public ApplicationPackage call(ApplicationPackageInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String applicationId, String version) { + ApplicationPackagesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, applicationId, version).toCompletable(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackagesInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackagesInner.java new file mode 100644 index 000000000000..bc238dba4332 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationPackagesInner.java @@ -0,0 +1,484 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.batch.v2017_09_01.ActivateApplicationPackageParameters; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApplicationPackages. + */ +public class ApplicationPackagesInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationPackagesService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of ApplicationPackagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationPackagesInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(ApplicationPackagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApplicationPackages to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationPackagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackages activate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}/activate") + Observable> activate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("version") String version, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ActivateApplicationPackageParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackages create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("version") String version, @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.batch.v2017_09_01.ApplicationPackages delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("version") String version, @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.batch.v2017_09_01.ApplicationPackages get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("version") String version, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Activates the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to activate. + * @param format The format of the application package binary file. + * @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 activate(String resourceGroupName, String accountName, String applicationId, String version, String format) { + activateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version, format).toBlocking().single().body(); + } + + /** + * Activates the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to activate. + * @param format The format of the application package binary file. + * @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 activateAsync(String resourceGroupName, String accountName, String applicationId, String version, String format, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(activateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version, format), serviceCallback); + } + + /** + * Activates the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to activate. + * @param format The format of the application package binary file. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable activateAsync(String resourceGroupName, String accountName, String applicationId, String version, String format) { + return activateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version, format).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Activates the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to activate. + * @param format The format of the application package binary file. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> activateWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version, String format) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + 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."); + } + if (format == null) { + throw new IllegalArgumentException("Parameter format is required and cannot be null."); + } + ActivateApplicationPackageParameters parameters = new ActivateApplicationPackageParameters(); + parameters.withFormat(format); + return service.activate(resourceGroupName, accountName, applicationId, version, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = activateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse activateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates an application package record. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @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 ApplicationPackageInner object if successful. + */ + public ApplicationPackageInner create(String resourceGroupName, String accountName, String applicationId, String version) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().body(); + } + + /** + * Creates an application package record. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @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 createAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + } + + /** + * Creates an application package record. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationPackageInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String applicationId, String version) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, ApplicationPackageInner>() { + @Override + public ApplicationPackageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates an application package record. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationPackageInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + 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.create(resourceGroupName, accountName, applicationId, version, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an application package record and its associated binary file. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to delete. + * @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 accountName, String applicationId, String version) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().body(); + } + + /** + * Deletes an application package record and its associated binary file. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to delete. + * @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 accountName, String applicationId, String version, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + } + + /** + * Deletes an application package record and its associated binary file. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String applicationId, String version) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an application package record and its associated binary file. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + 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.delete(resourceGroupName, accountName, applicationId, version, this.client.subscriptionId(), 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(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @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 ApplicationPackageInner object if successful. + */ + public ApplicationPackageInner get(String resourceGroupName, String accountName, String applicationId, String version) { + return getWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().body(); + } + + /** + * Gets information about the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @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 accountName, String applicationId, String version, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + } + + /** + * Gets information about the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationPackageInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String applicationId, String version) { + return getWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, ApplicationPackageInner>() { + @Override + public ApplicationPackageInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param version The version of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationPackageInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (version == null) { + throw new IllegalArgumentException("Parameter version is required and cannot be null."); + } + 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.get(resourceGroupName, accountName, applicationId, version, this.client.subscriptionId(), 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); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationsImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationsImpl.java new file mode 100644 index 000000000000..1e07a4fec174 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationsImpl.java @@ -0,0 +1,91 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.Applications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.batch.v2017_09_01.Application; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationUpdateParameters; + +class ApplicationsImpl extends WrapperImpl implements Applications { + private final BatchManager manager; + + ApplicationsImpl(BatchManager manager) { + super(manager.inner().applications()); + this.manager = manager; + } + + public BatchManager manager() { + return this.manager; + } + + private ApplicationImpl wrapModel(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + + @Override + public Observable createAsync(String resourceGroupName, String accountName, String applicationId) { + ApplicationsInner client = this.inner(); + return client.createAsync(resourceGroupName, accountName, applicationId) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return new ApplicationImpl(inner, manager()); + } + }); + } + + @Override + public Completable updateAsync(String resourceGroupName, String accountName, String applicationId, ApplicationUpdateParameters parameters) { + ApplicationsInner client = this.inner(); + return client.updateAsync(resourceGroupName, accountName, applicationId, parameters).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + ApplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String applicationId) { + ApplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, applicationId) + .map(new Func1() { + @Override + public Application call(ApplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String applicationId) { + ApplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, applicationId).toCompletable(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationsInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationsInner.java new file mode 100644 index 000000000000..84158a6e0ee7 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/ApplicationsInner.java @@ -0,0 +1,919 @@ +/** + * 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.batch.v2017_09_01.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.batch.v2017_09_01.ApplicationCreateParameters; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationUpdateParameters; +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.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 Applications. + */ +public class ApplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("subscriptionId") String subscriptionId, @Body ApplicationCreateParameters parameters, @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.batch.v2017_09_01.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @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.batch.v2017_09_01.Applications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @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.batch.v2017_09_01.Applications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("subscriptionId") String subscriptionId, @Body ApplicationUpdateParameters parameters, @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.batch.v2017_09_01.Applications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("maxresults") Integer maxresults, @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.batch.v2017_09_01.Applications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @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 ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String accountName, String applicationId) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().body(); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @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 createAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String applicationId) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + 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."); + } + final ApplicationCreateParameters parameters = null; + return service.create(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @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 ApplicationInner object if successful. + */ + public ApplicationInner create(String resourceGroupName, String accountName, String applicationId, ApplicationCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single().body(); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String accountName, String applicationId, ApplicationCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String applicationId, ApplicationCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, ApplicationCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + 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."); + } + Validator.validate(parameters); + return service.create(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes an application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @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 accountName, String applicationId) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().body(); + } + + /** + * Deletes an application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @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 accountName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + } + + /** + * Deletes an application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String applicationId) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes an application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + 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.delete(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), 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(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets information about the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @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 ApplicationInner object if successful. + */ + public ApplicationInner get(String resourceGroupName, String accountName, String applicationId) { + return getWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().body(); + } + + /** + * Gets information about the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @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 accountName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + } + + /** + * Gets information about the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String applicationId) { + return getWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + 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.get(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), 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); + } + + /** + * Updates settings for the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @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 update(String resourceGroupName, String accountName, String applicationId, ApplicationUpdateParameters parameters) { + updateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single().body(); + } + + /** + * Updates settings for the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String accountName, String applicationId, ApplicationUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + } + + /** + * Updates settings for the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateAsync(String resourceGroupName, String accountName, String applicationId, ApplicationUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates settings for the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The ID of the application. + * @param parameters The parameters for the request. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, ApplicationUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (applicationId == null) { + throw new IllegalArgumentException("Parameter applicationId is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.update(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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<ApplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .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 of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final Integer maxresults = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), maxresults, 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); + } + } + }); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @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<ApplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final Integer maxresults) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxresults).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @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 accountName, final Integer maxresults, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, maxresults), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { + return listSinglePageAsync(resourceGroupName, accountName, maxresults) + .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 of the applications in the specified account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the Batch account. + ServiceResponse> * @param accountName The name of the Batch account. + ServiceResponse> * @param maxresults The maximum number of items to return in the response. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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(resourceGroupName, accountName, this.client.subscriptionId(), maxresults, 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); + } + + /** + * Lists all of the applications in the specified account. + * + * @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<ApplicationInner> 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 of the applications in the specified account. + * + * @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 of the applications in the specified account. + * + * @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<ApplicationInner> 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 of the applications in the specified account. + * + * @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<ApplicationInner> 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 of the applications in the specified account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationInner> 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); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountImpl.java new file mode 100644 index 000000000000..ba55c6106152 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountImpl.java @@ -0,0 +1,145 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccount; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountUpdateParameters; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountCreateParameters; +import com.microsoft.azure.management.batch.v2017_09_01.AutoStorageProperties; +import com.microsoft.azure.management.batch.v2017_09_01.KeyVaultReference; +import com.microsoft.azure.management.batch.v2017_09_01.PoolAllocationMode; +import com.microsoft.azure.management.batch.v2017_09_01.ProvisioningState; +import com.microsoft.azure.management.batch.v2017_09_01.AutoStorageBaseProperties; +import rx.functions.Func1; + +class BatchAccountImpl extends GroupableResourceCoreImpl implements BatchAccount, BatchAccount.Definition, BatchAccount.Update { + private BatchAccountCreateParameters createParameter; + private BatchAccountUpdateParameters updateParameter; + BatchAccountImpl(String name, BatchAccountInner inner, BatchManager manager) { + super(name, inner, manager); + this.createParameter = new BatchAccountCreateParameters(); + this.updateParameter = new BatchAccountUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + BatchAccountsInner client = this.manager().inner().batchAccounts(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public BatchAccountInner call(BatchAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BatchAccountsInner client = this.manager().inner().batchAccounts(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public BatchAccountInner call(BatchAccountInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BatchAccountsInner client = this.manager().inner().batchAccounts(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new BatchAccountCreateParameters(); + this.updateParameter = new BatchAccountUpdateParameters(); + } + + @Override + public String accountEndpoint() { + return this.inner().accountEndpoint(); + } + + @Override + public int activeJobAndJobScheduleQuota() { + return this.inner().activeJobAndJobScheduleQuota(); + } + + @Override + public AutoStorageProperties autoStorage() { + return this.inner().autoStorage(); + } + + @Override + public int dedicatedCoreQuota() { + return this.inner().dedicatedCoreQuota(); + } + + @Override + public KeyVaultReference keyVaultReference() { + return this.inner().keyVaultReference(); + } + + @Override + public int lowPriorityCoreQuota() { + return this.inner().lowPriorityCoreQuota(); + } + + @Override + public PoolAllocationMode poolAllocationMode() { + return this.inner().poolAllocationMode(); + } + + @Override + public int poolQuota() { + return this.inner().poolQuota(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public BatchAccountImpl withKeyVaultReference(KeyVaultReference keyVaultReference) { + this.createParameter.withKeyVaultReference(keyVaultReference); + return this; + } + + @Override + public BatchAccountImpl withPoolAllocationMode(PoolAllocationMode poolAllocationMode) { + this.createParameter.withPoolAllocationMode(poolAllocationMode); + return this; + } + + @Override + public BatchAccountImpl withAutoStorage(AutoStorageBaseProperties autoStorage) { + if (isInCreateMode()) { + this.createParameter.withAutoStorage(autoStorage); + } else { + this.updateParameter.withAutoStorage(autoStorage); + } + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountInner.java new file mode 100644 index 000000000000..a6827d3b7c0a --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountInner.java @@ -0,0 +1,164 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.ProvisioningState; +import com.microsoft.azure.management.batch.v2017_09_01.PoolAllocationMode; +import com.microsoft.azure.management.batch.v2017_09_01.KeyVaultReference; +import com.microsoft.azure.management.batch.v2017_09_01.AutoStorageProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * Contains information about an Azure Batch account. + */ +@JsonFlatten +@SkipParentValidation +public class BatchAccountInner extends Resource { + /** + * The account endpoint used to interact with the Batch service. + */ + @JsonProperty(value = "properties.accountEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String accountEndpoint; + + /** + * The provisioned state of the resource. Possible values include: + * 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The allocation mode to use for creating pools in the Batch account. + * Possible values include: 'BatchService', 'UserSubscription'. + */ + @JsonProperty(value = "properties.poolAllocationMode", access = JsonProperty.Access.WRITE_ONLY) + private PoolAllocationMode poolAllocationMode; + + /** + * A reference to the Azure key vault associated with the Batch account. + */ + @JsonProperty(value = "properties.keyVaultReference", access = JsonProperty.Access.WRITE_ONLY) + private KeyVaultReference keyVaultReference; + + /** + * The properties and status of any auto-storage account associated with + * the Batch account. + */ + @JsonProperty(value = "properties.autoStorage", access = JsonProperty.Access.WRITE_ONLY) + private AutoStorageProperties autoStorage; + + /** + * The dedicated core quota for this Batch account. + */ + @JsonProperty(value = "properties.dedicatedCoreQuota", access = JsonProperty.Access.WRITE_ONLY) + private int dedicatedCoreQuota; + + /** + * The low-priority core quota for this Batch account. + */ + @JsonProperty(value = "properties.lowPriorityCoreQuota", access = JsonProperty.Access.WRITE_ONLY) + private int lowPriorityCoreQuota; + + /** + * The pool quota for this Batch account. + */ + @JsonProperty(value = "properties.poolQuota", access = JsonProperty.Access.WRITE_ONLY) + private int poolQuota; + + /** + * The active job and job schedule quota for this Batch account. + */ + @JsonProperty(value = "properties.activeJobAndJobScheduleQuota", access = JsonProperty.Access.WRITE_ONLY) + private int activeJobAndJobScheduleQuota; + + /** + * Get the account endpoint used to interact with the Batch service. + * + * @return the accountEndpoint value + */ + public String accountEndpoint() { + return this.accountEndpoint; + } + + /** + * Get the provisioned state of the resource. Possible values include: 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get possible values include: 'BatchService', 'UserSubscription'. + * + * @return the poolAllocationMode value + */ + public PoolAllocationMode poolAllocationMode() { + return this.poolAllocationMode; + } + + /** + * Get the keyVaultReference value. + * + * @return the keyVaultReference value + */ + public KeyVaultReference keyVaultReference() { + return this.keyVaultReference; + } + + /** + * Get the autoStorage value. + * + * @return the autoStorage value + */ + public AutoStorageProperties autoStorage() { + return this.autoStorage; + } + + /** + * Get the dedicatedCoreQuota value. + * + * @return the dedicatedCoreQuota value + */ + public int dedicatedCoreQuota() { + return this.dedicatedCoreQuota; + } + + /** + * Get the lowPriorityCoreQuota value. + * + * @return the lowPriorityCoreQuota value + */ + public int lowPriorityCoreQuota() { + return this.lowPriorityCoreQuota; + } + + /** + * Get the poolQuota value. + * + * @return the poolQuota value + */ + public int poolQuota() { + return this.poolQuota; + } + + /** + * Get the activeJobAndJobScheduleQuota value. + * + * @return the activeJobAndJobScheduleQuota value + */ + public int activeJobAndJobScheduleQuota() { + return this.activeJobAndJobScheduleQuota; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountKeysImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountKeysImpl.java new file mode 100644 index 000000000000..4aec1c482155 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountKeysImpl.java @@ -0,0 +1,41 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class BatchAccountKeysImpl extends WrapperImpl implements BatchAccountKeys { + private final BatchManager manager; + BatchAccountKeysImpl(BatchAccountKeysInner inner, BatchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + public String accountName() { + return this.inner().accountName(); + } + + @Override + public String primary() { + return this.inner().primary(); + } + + @Override + public String secondary() { + return this.inner().secondary(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountKeysInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountKeysInner.java new file mode 100644 index 000000000000..1a4cd7c2f26c --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountKeysInner.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.batch.v2017_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A set of Azure Batch account keys. + */ +public class BatchAccountKeysInner { + /** + * The Batch account name. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /** + * The primary key associated with the account. + */ + @JsonProperty(value = "primary", access = JsonProperty.Access.WRITE_ONLY) + private String primary; + + /** + * The secondary key associated with the account. + */ + @JsonProperty(value = "secondary", access = JsonProperty.Access.WRITE_ONLY) + private String secondary; + + /** + * Get the Batch account name. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the primary key associated with the account. + * + * @return the primary value + */ + public String primary() { + return this.primary; + } + + /** + * Get the secondary key associated with the account. + * + * @return the secondary value + */ + public String secondary() { + return this.secondary; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountsImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountsImpl.java new file mode 100644 index 000000000000..171de89cca0f --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountsImpl.java @@ -0,0 +1,170 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccounts; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccount; +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; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountKeys; +import com.microsoft.azure.management.batch.v2017_09_01.AccountKeyType; + +class BatchAccountsImpl extends GroupableResourcesCoreImpl implements BatchAccounts { + protected BatchAccountsImpl(BatchManager manager) { + super(manager.inner().batchAccounts(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + BatchAccountsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + BatchAccountsInner 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) { + BatchAccountsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + BatchAccountsInner 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 BatchAccount call(BatchAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + BatchAccountsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + BatchAccountsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BatchAccount call(BatchAccountInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public BatchAccountImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName) { + BatchAccountsInner client = this.inner(); + return client.synchronizeAutoStorageKeysAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + BatchAccountsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, accountName, keyName) + .map(new Func1() { + @Override + public BatchAccountKeys call(BatchAccountKeysInner inner) { + return new BatchAccountKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable getKeysAsync(String resourceGroupName, String accountName) { + BatchAccountsInner client = this.inner(); + return client.getKeysAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public BatchAccountKeys call(BatchAccountKeysInner inner) { + return new BatchAccountKeysImpl(inner, manager()); + } + }); + } + + @Override + protected BatchAccountImpl wrapModel(BatchAccountInner inner) { + return new BatchAccountImpl(inner.name(), inner, manager()); + } + + @Override + protected BatchAccountImpl wrapModel(String name) { + return new BatchAccountImpl(name, new BatchAccountInner(), this.manager()); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountsInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountsInner.java new file mode 100644 index 000000000000..a378c7a5ae0f --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchAccountsInner.java @@ -0,0 +1,1351 @@ +/** + * 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.batch.v2017_09_01.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.management.batch.v2017_09_01.AccountKeyType; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountCreateHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountCreateParameters; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountDeleteHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountRegenerateKeyParameters; +import com.microsoft.azure.management.batch.v2017_09_01.BatchAccountUpdateParameters; +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.ServiceResponseWithHeaders; +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 BatchAccounts. + */ +public class BatchAccountsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private BatchAccountsService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of BatchAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BatchAccountsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(BatchAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BatchAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface BatchAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.BatchAccounts create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body BatchAccountCreateParameters parameters, @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.batch.v2017_09_01.BatchAccounts beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body BatchAccountCreateParameters parameters, @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.batch.v2017_09_01.BatchAccounts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Body BatchAccountUpdateParameters parameters, @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.batch.v2017_09_01.BatchAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.batch.v2017_09_01.BatchAccounts beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.batch.v2017_09_01.BatchAccounts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.batch.v2017_09_01.BatchAccounts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts") + 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.batch.v2017_09_01.BatchAccounts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.batch.v2017_09_01.BatchAccounts synchronizeAutoStorageKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys") + Observable> synchronizeAutoStorageKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.batch.v2017_09_01.BatchAccounts regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys") + Observable> regenerateKey(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BatchAccountRegenerateKeyParameters parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.BatchAccounts getKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys") + Observable> getKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.batch.v2017_09_01.BatchAccounts 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.batch.v2017_09_01.BatchAccounts listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @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 BatchAccountInner object if successful. + */ + public BatchAccountInner create(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @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 createAsync(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BatchAccountInner>() { + @Override + public BatchAccountInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + Observable> observable = service.create(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), BatchAccountCreateHeaders.class); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @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 BatchAccountInner object if successful. + */ + public BatchAccountInner beginCreate(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @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 beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BatchAccountInner>() { + @Override + public BatchAccountInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.beginCreate(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BatchAccountCreateHeaders.class); + } + + /** + * Updates the properties of an existing Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @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 BatchAccountInner object if successful. + */ + public BatchAccountInner update(String resourceGroupName, String accountName, BatchAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @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 updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Updates the properties of an existing Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BatchAccountInner>() { + @Override + public BatchAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param parameters Additional parameters for account update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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 the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), BatchAccountDeleteHeaders.class); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, BatchAccountDeleteHeaders.class); + } + + /** + * Gets information about the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 BatchAccountInner object if successful. + */ + public BatchAccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets information about the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets information about the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BatchAccountInner>() { + @Override + public BatchAccountInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.getByResourceGroup(resourceGroupName, accountName, this.client.subscriptionId(), 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); + } + + /** + * Gets information about the Batch accounts associated with the 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<BatchAccountInner> 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 information about the Batch accounts associated with the 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 information about the Batch accounts associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BatchAccountInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about the Batch accounts associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BatchAccountInner> 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 information about the Batch accounts associated with the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BatchAccountInner> 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 information about the Batch accounts associated with the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @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<BatchAccountInner> 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 information about the Batch accounts associated with the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @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 information about the Batch accounts associated with the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BatchAccountInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about the Batch accounts associated with the specified resource group. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BatchAccountInner> 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 information about the Batch accounts associated with the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BatchAccountInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = 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); + } + + /** + * Synchronizes access keys for the auto-storage account configured for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 synchronizeAutoStorageKeys(String resourceGroupName, String accountName) { + synchronizeAutoStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Synchronizes access keys for the auto-storage account configured for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(synchronizeAutoStorageKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Synchronizes access keys for the auto-storage account configured for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName) { + return synchronizeAutoStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Synchronizes access keys for the auto-storage account configured for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> synchronizeAutoStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.synchronizeAutoStorageKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = synchronizeAutoStorageKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse synchronizeAutoStorageKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the specified account key for the Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' + * @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 BatchAccountKeysInner object if successful. + */ + public BatchAccountKeysInner regenerateKey(String resourceGroupName, String accountName, AccountKeyType keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates the specified account key for the Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' + * @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 regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates the specified account key for the Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, BatchAccountKeysInner>() { + @Override + public BatchAccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the specified account key for the Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + BatchAccountRegenerateKeyParameters parameters = new BatchAccountRegenerateKeyParameters(); + parameters.withKeyName(keyName); + return service.regenerateKey(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(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 the account keys for the specified Batch account. + * This operation applies only to Batch accounts created with a poolAllocationMode of 'BatchService'. If the Batch account was created with a poolAllocationMode of 'UserSubscription', clients cannot use access to keys to authenticate, and must use Azure Active Directory instead. In this case, getting the keys will fail. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 BatchAccountKeysInner object if successful. + */ + public BatchAccountKeysInner getKeys(String resourceGroupName, String accountName) { + return getKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the account keys for the specified Batch account. + * This operation applies only to Batch accounts created with a poolAllocationMode of 'BatchService'. If the Batch account was created with a poolAllocationMode of 'UserSubscription', clients cannot use access to keys to authenticate, and must use Azure Active Directory instead. In this case, getting the keys will fail. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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 getKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the account keys for the specified Batch account. + * This operation applies only to Batch accounts created with a poolAllocationMode of 'BatchService'. If the Batch account was created with a poolAllocationMode of 'UserSubscription', clients cannot use access to keys to authenticate, and must use Azure Active Directory instead. In this case, getting the keys will fail. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountKeysInner object + */ + public Observable getKeysAsync(String resourceGroupName, String accountName) { + return getKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BatchAccountKeysInner>() { + @Override + public BatchAccountKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the account keys for the specified Batch account. + * This operation applies only to Batch accounts created with a poolAllocationMode of 'BatchService'. If the Batch account was created with a poolAllocationMode of 'UserSubscription', clients cannot use access to keys to authenticate, and must use Azure Active Directory instead. In this case, getting the keys will fail. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchAccountKeysInner object + */ + public Observable> getKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.getKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getKeysDelegate(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 information about the Batch accounts associated with the 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<BatchAccountInner> 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 information about the Batch accounts associated with the 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 information about the Batch accounts associated with the 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<BatchAccountInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about the Batch accounts associated with the 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<BatchAccountInner> 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 information about the Batch accounts associated with the 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<BatchAccountInner> 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 information about the Batch accounts associated with the 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<BatchAccountInner> 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 information about the Batch accounts associated with the 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 information about the Batch accounts associated with the 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<BatchAccountInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets information about the Batch accounts associated with the 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<BatchAccountInner> 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 information about the Batch accounts associated with the 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<BatchAccountInner> 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/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchLocationQuotaImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchLocationQuotaImpl.java new file mode 100644 index 000000000000..0495080af5b6 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchLocationQuotaImpl.java @@ -0,0 +1,31 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.BatchLocationQuota; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class BatchLocationQuotaImpl extends WrapperImpl implements BatchLocationQuota { + private final BatchManager manager; + BatchLocationQuotaImpl(BatchLocationQuotaInner inner, BatchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + public Integer accountQuota() { + return this.inner().accountQuota(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchLocationQuotaInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchLocationQuotaInner.java new file mode 100644 index 000000000000..bfc27c49f713 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchLocationQuotaInner.java @@ -0,0 +1,33 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Quotas associated with a Batch region for a particular subscription. + */ +public class BatchLocationQuotaInner { + /** + * The number of Batch accounts that may be created under the subscription + * in the specified region. + */ + @JsonProperty(value = "accountQuota", access = JsonProperty.Access.WRITE_ONLY) + private Integer accountQuota; + + /** + * Get the number of Batch accounts that may be created under the subscription in the specified region. + * + * @return the accountQuota value + */ + public Integer accountQuota() { + return this.accountQuota; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchManagementClientImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchManagementClientImpl.java new file mode 100644 index 000000000000..15e8375603ef --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchManagementClientImpl.java @@ -0,0 +1,280 @@ +/** + * 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.batch.v2017_09_01.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 BatchManagementClientImpl class. + */ +public class BatchManagementClientImpl 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 Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). */ + private String subscriptionId; + + /** + * Gets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public BatchManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The API version to be used with the HTTP request. */ + private String apiVersion; + + /** + * Gets The API version to be used with the HTTP request. + * + * @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 BatchManagementClientImpl 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 BatchManagementClientImpl 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 BatchManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The BatchAccountsInner object to access its operations. + */ + private BatchAccountsInner batchAccounts; + + /** + * Gets the BatchAccountsInner object to access its operations. + * @return the BatchAccountsInner object. + */ + public BatchAccountsInner batchAccounts() { + return this.batchAccounts; + } + + /** + * The ApplicationPackagesInner object to access its operations. + */ + private ApplicationPackagesInner applicationPackages; + + /** + * Gets the ApplicationPackagesInner object to access its operations. + * @return the ApplicationPackagesInner object. + */ + public ApplicationPackagesInner applicationPackages() { + return this.applicationPackages; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The CertificatesInner object to access its operations. + */ + private CertificatesInner certificates; + + /** + * Gets the CertificatesInner object to access its operations. + * @return the CertificatesInner object. + */ + public CertificatesInner certificates() { + return this.certificates; + } + + /** + * The PoolsInner object to access its operations. + */ + private PoolsInner pools; + + /** + * Gets the PoolsInner object to access its operations. + * @return the PoolsInner object. + */ + public PoolsInner pools() { + return this.pools; + } + + /** + * Initializes an instance of BatchManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public BatchManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of BatchManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public BatchManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of BatchManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public BatchManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-09-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.batchAccounts = new BatchAccountsInner(restClient().retrofit(), this); + this.applicationPackages = new ApplicationPackagesInner(restClient().retrofit(), this); + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.certificates = new CertificatesInner(restClient().retrofit(), this); + this.pools = new PoolsInner(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(), "BatchManagementClient", "2017-09-01"); + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchManager.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchManager.java new file mode 100644 index 000000000000..d9cc780b26fa --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/BatchManager.java @@ -0,0 +1,171 @@ +/** + * 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.batch.v2017_09_01.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.batch.v2017_09_01.BatchAccounts; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackages; +import com.microsoft.azure.management.batch.v2017_09_01.Applications; +import com.microsoft.azure.management.batch.v2017_09_01.Locations; +import com.microsoft.azure.management.batch.v2017_09_01.Operations; +import com.microsoft.azure.management.batch.v2017_09_01.Certificates; +import com.microsoft.azure.management.batch.v2017_09_01.Pools; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Batch resource management. + */ +public final class BatchManager extends ManagerCore { + private BatchAccounts batchAccounts; + private ApplicationPackages applicationPackages; + private Applications applications; + private Locations locations; + private Operations operations; + private Certificates certificates; + private Pools pools; + /** + * Get a Configurable instance that can be used to create BatchManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new BatchManager.ConfigurableImpl(); + } + /** + * Creates an instance of BatchManager that exposes Batch resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the BatchManager + */ + public static BatchManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new BatchManager(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 BatchManager that exposes Batch resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the BatchManager + */ + public static BatchManager authenticate(RestClient restClient, String subscriptionId) { + return new BatchManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of BatchManager that exposes Batch management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Batch management API entry points that work across subscriptions + */ + BatchManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage BatchAccounts. + */ + public BatchAccounts batchAccounts() { + if (this.batchAccounts == null) { + this.batchAccounts = new BatchAccountsImpl(this); + } + return this.batchAccounts; + } + + /** + * @return Entry point to manage ApplicationPackages. + */ + public ApplicationPackages applicationPackages() { + if (this.applicationPackages == null) { + this.applicationPackages = new ApplicationPackagesImpl(this); + } + return this.applicationPackages; + } + + /** + * @return Entry point to manage Applications. + */ + public Applications applications() { + if (this.applications == null) { + this.applications = new ApplicationsImpl(this); + } + return this.applications; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Certificates. + */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(this); + } + return this.certificates; + } + + /** + * @return Entry point to manage Pools. + */ + public Pools pools() { + if (this.pools == null) { + this.pools = new PoolsImpl(this); + } + return this.pools; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public BatchManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return BatchManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private BatchManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new BatchManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificateImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificateImpl.java new file mode 100644 index 000000000000..8a3c1b322f59 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificateImpl.java @@ -0,0 +1,219 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.Certificate; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateCreateOrUpdateParameters; +import com.microsoft.azure.management.batch.v2017_09_01.DeleteCertificateError; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateFormat; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateProvisioningState; +import org.joda.time.DateTime; +import rx.functions.Func1; + +class CertificateImpl extends CreatableUpdatableImpl implements Certificate, Certificate.Definition, Certificate.Update { + private final BatchManager manager; + private String resourceGroupName; + private String accountName; + private String certificateName; + private String cifMatch; + private String cifNoneMatch; + private String uifMatch; + private CertificateCreateOrUpdateParameters createOrUpdateParameter; + + CertificateImpl(String name, BatchManager manager) { + super(name, new CertificateInner()); + this.manager = manager; + // Set resource name + this.certificateName = name; + // + this.createOrUpdateParameter = new CertificateCreateOrUpdateParameters(); + } + + CertificateImpl(CertificateInner inner, BatchManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.certificateName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "batchAccounts"); + this.certificateName = IdParsingUtils.getValueFromIdByName(inner.id(), "certificates"); + // + this.createOrUpdateParameter = new CertificateCreateOrUpdateParameters(); + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.createAsync(this.resourceGroupName, this.accountName, this.certificateName, this.createOrUpdateParameter, this.cifMatch, this.cifNoneMatch) + .map(new Func1() { + @Override + public CertificateInner call(CertificateInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.certificateName, this.createOrUpdateParameter, this.uifMatch) + .map(new Func1() { + @Override + public CertificateInner call(CertificateInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CertificatesInner client = this.manager().inner().certificates(); + return client.getAsync(this.resourceGroupName, this.accountName, this.certificateName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createOrUpdateParameter = new CertificateCreateOrUpdateParameters(); + } + + @Override + public DeleteCertificateError deleteCertificateError() { + return this.inner().deleteCertificateError(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public CertificateFormat format() { + return this.inner().format(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public CertificateProvisioningState previousProvisioningState() { + return this.inner().previousProvisioningState(); + } + + @Override + public DateTime previousProvisioningStateTransitionTime() { + return this.inner().previousProvisioningStateTransitionTime(); + } + + @Override + public CertificateProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DateTime provisioningStateTransitionTime() { + return this.inner().provisioningStateTransitionTime(); + } + + @Override + public String publicData() { + return this.inner().publicData(); + } + + @Override + public String thumbprint() { + return this.inner().thumbprint(); + } + + @Override + public String thumbprintAlgorithm() { + return this.inner().thumbprintAlgorithm(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CertificateImpl withExistingBatchAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public CertificateImpl withIfNoneMatch(String ifNoneMatch) { + this.cifNoneMatch = ifNoneMatch; + return this; + } + + @Override + public CertificateImpl withData(String data) { + this.createOrUpdateParameter.withData(data); + return this; + } + + @Override + public CertificateImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public CertificateImpl withFormat(CertificateFormat format) { + this.createOrUpdateParameter.withFormat(format); + return this; + } + + @Override + public CertificateImpl withPassword(String password) { + this.createOrUpdateParameter.withPassword(password); + return this; + } + + @Override + public CertificateImpl withThumbprint(String thumbprint) { + this.createOrUpdateParameter.withThumbprint(thumbprint); + return this; + } + + @Override + public CertificateImpl withThumbprintAlgorithm(String thumbprintAlgorithm) { + this.createOrUpdateParameter.withThumbprintAlgorithm(thumbprintAlgorithm); + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificateInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificateInner.java new file mode 100644 index 000000000000..82e64b43c6d0 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificateInner.java @@ -0,0 +1,231 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.CertificateFormat; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.batch.v2017_09_01.DeleteCertificateError; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Contains information about a certificate. + */ +@JsonFlatten +public class CertificateInner extends ProxyResource { + /** + * The algorithm of the certificate thumbprint. + * This must match the first portion of the certificate name. Currently + * required to be 'SHA1'. + */ + @JsonProperty(value = "properties.thumbprintAlgorithm") + private String thumbprintAlgorithm; + + /** + * The thumbprint of the certificate. + * This must match the thumbprint from the name. + */ + @JsonProperty(value = "properties.thumbprint") + private String thumbprint; + + /** + * The format of the certificate - either Pfx or Cer. If omitted, the + * default is Pfx. Possible values include: 'Pfx', 'Cer'. + */ + @JsonProperty(value = "properties.format") + private CertificateFormat format; + + /** + * The provisioned state of the resource. + * Values are: + * + * Succeeded - The certificate is available for use in pools. + * Deleting - The user has requested that the certificate be deleted, but + * the delete operation has not yet completed. You may not reference the + * certificate when creating or updating pools. + * Failed - The user requested that the certificate be deleted, but there + * are pools that still have references to the certificate, or it is still + * installed on one or more compute nodes. (The latter can occur if the + * certificate has been removed from the pool, but the node has not yet + * restarted. Nodes refresh their certificates only when they restart.) You + * may use the cancel certificate delete operation to cancel the delete, or + * the delete certificate operation to retry the delete. Possible values + * include: 'Succeeded', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CertificateProvisioningState provisioningState; + + /** + * The time at which the certificate entered its current state. + */ + @JsonProperty(value = "properties.provisioningStateTransitionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime provisioningStateTransitionTime; + + /** + * The previous provisioned state of the resource. Possible values include: + * 'Succeeded', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.previousProvisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CertificateProvisioningState previousProvisioningState; + + /** + * The time at which the certificate entered its previous state. + */ + @JsonProperty(value = "properties.previousProvisioningStateTransitionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime previousProvisioningStateTransitionTime; + + /** + * The public key of the certificate. + */ + @JsonProperty(value = "properties.publicData", access = JsonProperty.Access.WRITE_ONLY) + private String publicData; + + /** + * The error which occurred while deleting the certificate. + * This is only returned when the certificate provisioningState is + * 'Failed'. + */ + @JsonProperty(value = "properties.deleteCertificateError", access = JsonProperty.Access.WRITE_ONLY) + private DeleteCertificateError deleteCertificateError; + + /** + * The ETag of the resource, used for concurrency statements. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get this must match the first portion of the certificate name. Currently required to be 'SHA1'. + * + * @return the thumbprintAlgorithm value + */ + public String thumbprintAlgorithm() { + return this.thumbprintAlgorithm; + } + + /** + * Set this must match the first portion of the certificate name. Currently required to be 'SHA1'. + * + * @param thumbprintAlgorithm the thumbprintAlgorithm value to set + * @return the CertificateInner object itself. + */ + public CertificateInner withThumbprintAlgorithm(String thumbprintAlgorithm) { + this.thumbprintAlgorithm = thumbprintAlgorithm; + return this; + } + + /** + * Get this must match the thumbprint from the name. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set this must match the thumbprint from the name. + * + * @param thumbprint the thumbprint value to set + * @return the CertificateInner object itself. + */ + public CertificateInner withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'. + * + * @return the format value + */ + public CertificateFormat format() { + return this.format; + } + + /** + * Set the format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. Possible values include: 'Pfx', 'Cer'. + * + * @param format the format value to set + * @return the CertificateInner object itself. + */ + public CertificateInner withFormat(CertificateFormat format) { + this.format = format; + return this; + } + + /** + * Get values are: + Succeeded - The certificate is available for use in pools. + Deleting - The user has requested that the certificate be deleted, but the delete operation has not yet completed. You may not reference the certificate when creating or updating pools. + Failed - The user requested that the certificate be deleted, but there are pools that still have references to the certificate, or it is still installed on one or more compute nodes. (The latter can occur if the certificate has been removed from the pool, but the node has not yet restarted. Nodes refresh their certificates only when they restart.) You may use the cancel certificate delete operation to cancel the delete, or the delete certificate operation to retry the delete. Possible values include: 'Succeeded', 'Deleting', 'Failed'. + * + * @return the provisioningState value + */ + public CertificateProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningStateTransitionTime value. + * + * @return the provisioningStateTransitionTime value + */ + public DateTime provisioningStateTransitionTime() { + return this.provisioningStateTransitionTime; + } + + /** + * Get the previous provisioned state of the resource. Possible values include: 'Succeeded', 'Deleting', 'Failed'. + * + * @return the previousProvisioningState value + */ + public CertificateProvisioningState previousProvisioningState() { + return this.previousProvisioningState; + } + + /** + * Get the previousProvisioningStateTransitionTime value. + * + * @return the previousProvisioningStateTransitionTime value + */ + public DateTime previousProvisioningStateTransitionTime() { + return this.previousProvisioningStateTransitionTime; + } + + /** + * Get the public key of the certificate. + * + * @return the publicData value + */ + public String publicData() { + return this.publicData; + } + + /** + * Get this is only returned when the certificate provisioningState is 'Failed'. + * + * @return the deleteCertificateError value + */ + public DeleteCertificateError deleteCertificateError() { + return this.deleteCertificateError; + } + + /** + * Get the ETag of the resource, used for concurrency statements. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificatesImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificatesImpl.java new file mode 100644 index 000000000000..dd23c908f515 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificatesImpl.java @@ -0,0 +1,93 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.Certificates; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.batch.v2017_09_01.Certificate; + +class CertificatesImpl extends WrapperImpl implements Certificates { + private final BatchManager manager; + + CertificatesImpl(BatchManager manager) { + super(manager.inner().certificates()); + this.manager = manager; + } + + public BatchManager manager() { + return this.manager; + } + + @Override + public CertificateImpl define(String name) { + return wrapModel(name); + } + + private CertificateImpl wrapModel(CertificateInner inner) { + return new CertificateImpl(inner, manager()); + } + + private CertificateImpl wrapModel(String name) { + return new CertificateImpl(name, this.manager()); + } + + @Override + public Observable cancelDeletionAsync(String resourceGroupName, String accountName, String certificateName) { + CertificatesInner client = this.inner(); + return client.cancelDeletionAsync(resourceGroupName, accountName, certificateName) + .map(new Func1() { + @Override + public Certificate call(CertificateInner inner) { + return new CertificateImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBatchAccountAsync(final String resourceGroupName, final String accountName) { + CertificatesInner client = this.inner(); + return client.listByBatchAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Certificate call(CertificateInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String certificateName) { + CertificatesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, certificateName) + .map(new Func1() { + @Override + public Certificate call(CertificateInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String certificateName) { + CertificatesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, certificateName).toCompletable(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificatesInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificatesInner.java new file mode 100644 index 000000000000..e0d2884de4d7 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CertificatesInner.java @@ -0,0 +1,1420 @@ +/** + * 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.batch.v2017_09_01.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.batch.v2017_09_01.CertificateCancelDeletionHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateCreateHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateCreateOrUpdateParameters; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateDeleteHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateGetHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateUpdateHeaders; +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.ServiceResponseWithHeaders; +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 Certificates. + */ +public class CertificatesInner { + /** The Retrofit service to perform REST calls. */ + private CertificatesService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of CertificatesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CertificatesInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(CertificatesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Certificates to be + * used by Retrofit to perform actually REST calls. + */ + interface CertificatesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.Certificates listByBatchAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates") + Observable> listByBatchAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("maxresults") Integer maxresults, @Query("$select") String select, @Query("$filter") String filter, @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.batch.v2017_09_01.Certificates create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @Path("subscriptionId") String subscriptionId, @Body CertificateCreateOrUpdateParameters parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @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.batch.v2017_09_01.Certificates beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @Path("subscriptionId") String subscriptionId, @Body CertificateCreateOrUpdateParameters parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @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.batch.v2017_09_01.Certificates update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @Path("subscriptionId") String subscriptionId, @Body CertificateCreateOrUpdateParameters parameters, @Header("If-Match") String ifMatch, @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.batch.v2017_09_01.Certificates delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @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.batch.v2017_09_01.Certificates beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @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.batch.v2017_09_01.Certificates get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @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.batch.v2017_09_01.Certificates cancelDeletion" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete") + Observable> cancelDeletion(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("certificateName") String certificateName, @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.batch.v2017_09_01.Certificates listByBatchAccountNext" }) + @GET + Observable> listByBatchAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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<CertificateInner> object if successful. + */ + public PagedList listByBatchAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByBatchAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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> listByBatchAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBatchAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable> listByBatchAccountAsync(final String resourceGroupName, final String accountName) { + return listByBatchAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable>> listByBatchAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByBatchAccountSinglePageAsync(resourceGroupName, accountName) + .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(listByBatchAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBatchAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final Integer maxresults = null; + final String select = null; + final String filter = null; + return service.listByBatchAccount(resourceGroupName, accountName, this.client.subscriptionId(), maxresults, select, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBatchAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are "properties/provisioningState", "properties/provisioningStateTransitionTime", "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<CertificateInner> object if successful. + */ + public PagedList listByBatchAccount(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + ServiceResponse> response = listByBatchAccountSinglePageAsync(resourceGroupName, accountName, maxresults, select, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are "properties/provisioningState", "properties/provisioningStateTransitionTime", "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> listByBatchAccountAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBatchAccountSinglePageAsync(resourceGroupName, accountName, maxresults, select, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are "properties/provisioningState", "properties/provisioningStateTransitionTime", "name". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable> listByBatchAccountAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + return listByBatchAccountWithServiceResponseAsync(resourceGroupName, accountName, maxresults, select, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are "properties/provisioningState", "properties/provisioningStateTransitionTime", "name". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable>> listByBatchAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + return listByBatchAccountSinglePageAsync(resourceGroupName, accountName, maxresults, select, 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(listByBatchAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the Batch account. + ServiceResponse> * @param accountName The name of the Batch account. + ServiceResponse> * @param maxresults The maximum number of items to return in the response. + ServiceResponse> * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + ServiceResponse> * @param filter OData filter expression. Valid properties for filtering are "properties/provisioningState", "properties/provisioningStateTransitionTime", "name". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBatchAccountSinglePageAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.listByBatchAccount(resourceGroupName, accountName, this.client.subscriptionId(), maxresults, select, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBatchAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBatchAccountDelegate(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); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @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 CertificateInner object if successful. + */ + public CertificateInner create(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @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 createAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters), serviceCallback); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + Observable> observable = service.create(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CertificateCreateHeaders.class); + } + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @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 CertificateInner object if successful. + */ + public CertificateInner create(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch) { + return createWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch, ifNoneMatch).toBlocking().last().body(); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @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 createAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch) { + return createWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch, ifNoneMatch).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + Observable> observable = service.create(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CertificateCreateHeaders.class); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @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 CertificateInner object if successful. + */ + public CertificateInner beginCreate(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @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 beginCreateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters), serviceCallback); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + return service.beginCreate(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @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 CertificateInner object if successful. + */ + public CertificateInner beginCreate(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch, ifNoneMatch).toBlocking().single().body(); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @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 beginCreateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch, ifNoneMatch).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new certificate inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Additional parameters for certificate creation. + * @param ifMatch The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.beginCreate(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, CertificateCreateHeaders.class); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @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 CertificateInner object if successful. + */ + public CertificateInner update(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @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 updateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters), serviceCallback); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + final String ifMatch = null; + return service.update(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param ifMatch The entity state (ETag) version of the certificate to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @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 CertificateInner object if successful. + */ + public CertificateInner update(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param ifMatch The entity state (ETag) version of the certificate to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @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 updateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch), serviceCallback); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param ifMatch The entity state (ETag) version of the certificate to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, certificateName, parameters, ifMatch).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @param parameters Certificate entity to update. + * @param ifMatch The entity state (ETag) version of the certificate to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName, CertificateCreateOrUpdateParameters parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.update(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, CertificateUpdateHeaders.class); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 accountName, String certificateName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, certificateName).toBlocking().last().body(); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 accountName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, certificateName), serviceCallback); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String certificateName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, certificateName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), CertificateDeleteHeaders.class); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 beginDelete(String resourceGroupName, String accountName, String certificateName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, certificateName).toBlocking().single().body(); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 beginDeleteAsync(String resourceGroupName, String accountName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, certificateName), serviceCallback); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String certificateName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, certificateName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, CertificateDeleteHeaders.class); + } + + /** + * Gets information about the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 CertificateInner object if successful. + */ + public CertificateInner get(String resourceGroupName, String accountName, String certificateName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, certificateName).toBlocking().single().body(); + } + + /** + * Gets information about the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 accountName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, accountName, certificateName), serviceCallback); + } + + /** + * Gets information about the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String certificateName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, certificateName).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + 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.get(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, CertificateGetHeaders.class); + } + + /** + * Cancels a failed deletion of a certificate from the specified account. + * If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 CertificateInner object if successful. + */ + public CertificateInner cancelDeletion(String resourceGroupName, String accountName, String certificateName) { + return cancelDeletionWithServiceResponseAsync(resourceGroupName, accountName, certificateName).toBlocking().single().body(); + } + + /** + * Cancels a failed deletion of a certificate from the specified account. + * If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @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 cancelDeletionAsync(String resourceGroupName, String accountName, String certificateName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(cancelDeletionWithServiceResponseAsync(resourceGroupName, accountName, certificateName), serviceCallback); + } + + /** + * Cancels a failed deletion of a certificate from the specified account. + * If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable cancelDeletionAsync(String resourceGroupName, String accountName, String certificateName) { + return cancelDeletionWithServiceResponseAsync(resourceGroupName, accountName, certificateName).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Cancels a failed deletion of a certificate from the specified account. + * If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param certificateName The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CertificateInner object + */ + public Observable> cancelDeletionWithServiceResponseAsync(String resourceGroupName, String accountName, String certificateName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (certificateName == null) { + throw new IllegalArgumentException("Parameter certificateName is required and cannot be null."); + } + 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.cancelDeletion(resourceGroupName, accountName, certificateName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = cancelDeletionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders cancelDeletionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, CertificateCancelDeletionHeaders.class); + } + + /** + * Lists all of the certificates in the specified account. + * + * @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<CertificateInner> object if successful. + */ + public PagedList listByBatchAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the certificates in the specified account. + * + * @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> listByBatchAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBatchAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the certificates in the specified account. + * + * @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<CertificateInner> object + */ + public Observable> listByBatchAccountNextAsync(final String nextPageLink) { + return listByBatchAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + * @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<CertificateInner> object + */ + public Observable>> listByBatchAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(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(listByBatchAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the certificates in the specified account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBatchAccountNextSinglePageAsync(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.listByBatchAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBatchAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBatchAccountNextDelegate(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/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CheckNameAvailabilityResultImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CheckNameAvailabilityResultImpl.java new file mode 100644 index 000000000000..d30c6485348b --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CheckNameAvailabilityResultImpl.java @@ -0,0 +1,42 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.CheckNameAvailabilityResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.NameAvailabilityReason; + +class CheckNameAvailabilityResultImpl extends WrapperImpl implements CheckNameAvailabilityResult { + private final BatchManager manager; + CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, BatchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public NameAvailabilityReason reason() { + return this.inner().reason(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CheckNameAvailabilityResultInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CheckNameAvailabilityResultInner.java new file mode 100644 index 000000000000..cda09adabb3e --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/CheckNameAvailabilityResultInner.java @@ -0,0 +1,67 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.NameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameAvailability operation response. + */ +public class CheckNameAvailabilityResultInner { + /** + * Gets a boolean value that indicates whether the name is available for + * you to use. If true, the name is available. If false, the name has + * already been taken or invalid and cannot be used. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * Gets the reason that a Batch account name could not be used. The Reason + * element is only returned if NameAvailable is false. Possible values + * include: 'Invalid', 'AlreadyExists'. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private NameAvailabilityReason reason; + + /** + * Gets an error message explaining the Reason value in more detail. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists'. + * + * @return the reason value + */ + public NameAvailabilityReason reason() { + return this.reason; + } + + /** + * Get gets an error message explaining the Reason value in more detail. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/IdParsingUtils.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..f02372ce7ffc --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/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.batch.v2017_09_01.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/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/LocationsImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/LocationsImpl.java new file mode 100644 index 000000000000..b87b9192a22c --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/LocationsImpl.java @@ -0,0 +1,55 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.Locations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.batch.v2017_09_01.BatchLocationQuota; +import com.microsoft.azure.management.batch.v2017_09_01.CheckNameAvailabilityResult; + +class LocationsImpl extends WrapperImpl implements Locations { + private final BatchManager manager; + + LocationsImpl(BatchManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public BatchManager manager() { + return this.manager; + } + + @Override + public Observable getQuotasAsync(String locationName) { + LocationsInner client = this.inner(); + return client.getQuotasAsync(locationName) + .map(new Func1() { + @Override + public BatchLocationQuota call(BatchLocationQuotaInner inner) { + return new BatchLocationQuotaImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String locationName, String name) { + LocationsInner client = this.inner(); + return client.checkNameAvailabilityAsync(locationName, name) + .map(new Func1() { + @Override + public CheckNameAvailabilityResult call(CheckNameAvailabilityResultInner inner) { + return new CheckNameAvailabilityResultImpl(inner, manager()); + } + }); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/LocationsInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/LocationsInner.java new file mode 100644 index 000000000000..c446bbdb6542 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/LocationsInner.java @@ -0,0 +1,234 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.batch.v2017_09_01.CheckNameAvailabilityParameters; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.Locations getQuotas" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas") + Observable> getQuotas(@Path("locationName") String locationName, @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.batch.v2017_09_01.Locations checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CheckNameAvailabilityParameters parameters, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the Batch service quotas for the specified subscription at the given location. + * + * @param locationName The region for which to retrieve Batch service quotas. + * @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 BatchLocationQuotaInner object if successful. + */ + public BatchLocationQuotaInner getQuotas(String locationName) { + return getQuotasWithServiceResponseAsync(locationName).toBlocking().single().body(); + } + + /** + * Gets the Batch service quotas for the specified subscription at the given location. + * + * @param locationName The region for which to retrieve Batch service quotas. + * @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 getQuotasAsync(String locationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getQuotasWithServiceResponseAsync(locationName), serviceCallback); + } + + /** + * Gets the Batch service quotas for the specified subscription at the given location. + * + * @param locationName The region for which to retrieve Batch service quotas. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchLocationQuotaInner object + */ + public Observable getQuotasAsync(String locationName) { + return getQuotasWithServiceResponseAsync(locationName).map(new Func1, BatchLocationQuotaInner>() { + @Override + public BatchLocationQuotaInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the Batch service quotas for the specified subscription at the given location. + * + * @param locationName The region for which to retrieve Batch service quotas. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BatchLocationQuotaInner object + */ + public Observable> getQuotasWithServiceResponseAsync(String locationName) { + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + 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.getQuotas(locationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getQuotasDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getQuotasDelegate(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); + } + + /** + * Checks whether the Batch account name is available in the specified region. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @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 CheckNameAvailabilityResultInner object if successful. + */ + public CheckNameAvailabilityResultInner checkNameAvailability(String locationName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, name).toBlocking().single().body(); + } + + /** + * Checks whether the Batch account name is available in the specified region. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @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 checkNameAvailabilityAsync(String locationName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(locationName, name), serviceCallback); + } + + /** + * Checks whether the Batch account name is available in the specified region. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable checkNameAvailabilityAsync(String locationName, String name) { + return checkNameAvailabilityWithServiceResponseAsync(locationName, name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the Batch account name is available in the specified region. + * + * @param locationName The desired region for the name check. + * @param name The name to check for availability + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String locationName, String name) { + if (locationName == null) { + throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); + } + 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."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + CheckNameAvailabilityParameters parameters = new CheckNameAvailabilityParameters(); + parameters.withName(name); + return service.checkNameAvailability(locationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(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); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..79662771a867 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationImpl.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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final BatchManager manager; + OperationImpl(OperationInner inner, BatchManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationInner.java new file mode 100644 index 000000000000..3d1773bf2495 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationInner.java @@ -0,0 +1,123 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A REST API operation. + */ +public class OperationInner { + /** + * The operation name. + * This is of the format {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * The intended executor of the operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Properties of the operation. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get this is of the format {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set this is of the format {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin value. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin value. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationsImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..8fdf33aa1046 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.batch.v2017_09_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final BatchManager manager; + + OperationsImpl(BatchManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public BatchManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationsInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..534574132e51 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.batch.v2017_09_01.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.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.Operations list" }) + @GET("providers/Microsoft.Batch/operations") + Observable> list(@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.batch.v2017_09_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @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<OperationInner> 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(); + } + }; + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @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); + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> 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)); + } + }); + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(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); + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @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<OperationInner> 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 available operations for the Microsoft.Batch provider. + * + * @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 available operations for the Microsoft.Batch provider. + * + * @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<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists available operations for the Microsoft.Batch provider. + * + * @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<OperationInner> 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 available operations for the Microsoft.Batch provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> 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); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PageImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PageImpl.java new file mode 100644 index 000000000000..0cf84e6cdc78 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/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.batch.v2017_09_01.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/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolImpl.java new file mode 100644 index 000000000000..b6441a2347fb --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolImpl.java @@ -0,0 +1,338 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.management.batch.v2017_09_01.Pool; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.batch.v2017_09_01.PoolProvisioningState; +import com.microsoft.azure.management.batch.v2017_09_01.AllocationState; +import com.microsoft.azure.management.batch.v2017_09_01.DeploymentConfiguration; +import com.microsoft.azure.management.batch.v2017_09_01.ScaleSettings; +import com.microsoft.azure.management.batch.v2017_09_01.AutoScaleRun; +import com.microsoft.azure.management.batch.v2017_09_01.InterNodeCommunicationState; +import com.microsoft.azure.management.batch.v2017_09_01.NetworkConfiguration; +import com.microsoft.azure.management.batch.v2017_09_01.TaskSchedulingPolicy; +import java.util.List; +import com.microsoft.azure.management.batch.v2017_09_01.UserAccount; +import com.microsoft.azure.management.batch.v2017_09_01.MetadataItem; +import com.microsoft.azure.management.batch.v2017_09_01.StartTask; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateReference; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackageReference; +import com.microsoft.azure.management.batch.v2017_09_01.ResizeOperationStatus; + +class PoolImpl extends CreatableUpdatableImpl implements Pool, Pool.Definition, Pool.Update { + private final BatchManager manager; + private String resourceGroupName; + private String accountName; + private String poolName; + private String cifMatch; + private String cifNoneMatch; + private String uifMatch; + + PoolImpl(String name, BatchManager manager) { + super(name, new PoolInner()); + this.manager = manager; + // Set resource name + this.poolName = name; + // + } + + PoolImpl(PoolInner inner, BatchManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.poolName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "batchAccounts"); + this.poolName = IdParsingUtils.getValueFromIdByName(inner.id(), "pools"); + // + } + + @Override + public BatchManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.createAsync(this.resourceGroupName, this.accountName, this.poolName, this.inner(), this.cifMatch, this.cifNoneMatch) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.poolName, this.inner(), this.uifMatch) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PoolsInner client = this.manager().inner().pools(); + return client.getAsync(this.resourceGroupName, this.accountName, this.poolName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AllocationState allocationState() { + return this.inner().allocationState(); + } + + @Override + public DateTime allocationStateTransitionTime() { + return this.inner().allocationStateTransitionTime(); + } + + @Override + public List applicationLicenses() { + return this.inner().applicationLicenses(); + } + + @Override + public List applicationPackages() { + return this.inner().applicationPackages(); + } + + @Override + public AutoScaleRun autoScaleRun() { + return this.inner().autoScaleRun(); + } + + @Override + public List certificates() { + return this.inner().certificates(); + } + + @Override + public DateTime creationTime() { + return this.inner().creationTime(); + } + + @Override + public Integer currentDedicatedNodes() { + return this.inner().currentDedicatedNodes(); + } + + @Override + public Integer currentLowPriorityNodes() { + return this.inner().currentLowPriorityNodes(); + } + + @Override + public DeploymentConfiguration deploymentConfiguration() { + return this.inner().deploymentConfiguration(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public InterNodeCommunicationState interNodeCommunication() { + return this.inner().interNodeCommunication(); + } + + @Override + public DateTime lastModified() { + return this.inner().lastModified(); + } + + @Override + public Integer maxTasksPerNode() { + return this.inner().maxTasksPerNode(); + } + + @Override + public List metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public NetworkConfiguration networkConfiguration() { + return this.inner().networkConfiguration(); + } + + @Override + public PoolProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DateTime provisioningStateTransitionTime() { + return this.inner().provisioningStateTransitionTime(); + } + + @Override + public ResizeOperationStatus resizeOperationStatus() { + return this.inner().resizeOperationStatus(); + } + + @Override + public ScaleSettings scaleSettings() { + return this.inner().scaleSettings(); + } + + @Override + public StartTask startTask() { + return this.inner().startTask(); + } + + @Override + public TaskSchedulingPolicy taskSchedulingPolicy() { + return this.inner().taskSchedulingPolicy(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public List userAccounts() { + return this.inner().userAccounts(); + } + + @Override + public String vmSize() { + return this.inner().vmSize(); + } + + @Override + public PoolImpl withExistingBatchAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public PoolImpl withIfNoneMatch(String ifNoneMatch) { + this.cifNoneMatch = ifNoneMatch; + return this; + } + + @Override + public PoolImpl withIfMatch(String ifMatch) { + if (isInCreateMode()) { + this.cifMatch = ifMatch; + } else { + this.uifMatch = ifMatch; + } + return this; + } + + @Override + public PoolImpl withApplicationLicenses(List applicationLicenses) { + this.inner().withApplicationLicenses(applicationLicenses); + return this; + } + + @Override + public PoolImpl withApplicationPackages(List applicationPackages) { + this.inner().withApplicationPackages(applicationPackages); + return this; + } + + @Override + public PoolImpl withCertificates(List certificates) { + this.inner().withCertificates(certificates); + return this; + } + + @Override + public PoolImpl withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) { + this.inner().withDeploymentConfiguration(deploymentConfiguration); + return this; + } + + @Override + public PoolImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public PoolImpl withInterNodeCommunication(InterNodeCommunicationState interNodeCommunication) { + this.inner().withInterNodeCommunication(interNodeCommunication); + return this; + } + + @Override + public PoolImpl withMaxTasksPerNode(Integer maxTasksPerNode) { + this.inner().withMaxTasksPerNode(maxTasksPerNode); + return this; + } + + @Override + public PoolImpl withMetadata(List metadata) { + this.inner().withMetadata(metadata); + return this; + } + + @Override + public PoolImpl withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.inner().withNetworkConfiguration(networkConfiguration); + return this; + } + + @Override + public PoolImpl withScaleSettings(ScaleSettings scaleSettings) { + this.inner().withScaleSettings(scaleSettings); + return this; + } + + @Override + public PoolImpl withStartTask(StartTask startTask) { + this.inner().withStartTask(startTask); + return this; + } + + @Override + public PoolImpl withTaskSchedulingPolicy(TaskSchedulingPolicy taskSchedulingPolicy) { + this.inner().withTaskSchedulingPolicy(taskSchedulingPolicy); + return this; + } + + @Override + public PoolImpl withUserAccounts(List userAccounts) { + this.inner().withUserAccounts(userAccounts); + return this; + } + + @Override + public PoolImpl withVmSize(String vmSize) { + this.inner().withVmSize(vmSize); + return this; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolInner.java new file mode 100644 index 000000000000..4df5ab5cad51 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolInner.java @@ -0,0 +1,639 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.batch.v2017_09_01.PoolProvisioningState; +import com.microsoft.azure.management.batch.v2017_09_01.AllocationState; +import com.microsoft.azure.management.batch.v2017_09_01.DeploymentConfiguration; +import com.microsoft.azure.management.batch.v2017_09_01.ScaleSettings; +import com.microsoft.azure.management.batch.v2017_09_01.AutoScaleRun; +import com.microsoft.azure.management.batch.v2017_09_01.InterNodeCommunicationState; +import com.microsoft.azure.management.batch.v2017_09_01.NetworkConfiguration; +import com.microsoft.azure.management.batch.v2017_09_01.TaskSchedulingPolicy; +import java.util.List; +import com.microsoft.azure.management.batch.v2017_09_01.UserAccount; +import com.microsoft.azure.management.batch.v2017_09_01.MetadataItem; +import com.microsoft.azure.management.batch.v2017_09_01.StartTask; +import com.microsoft.azure.management.batch.v2017_09_01.CertificateReference; +import com.microsoft.azure.management.batch.v2017_09_01.ApplicationPackageReference; +import com.microsoft.azure.management.batch.v2017_09_01.ResizeOperationStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Contains information about a pool. + */ +@JsonFlatten +public class PoolInner extends ProxyResource { + /** + * The display name for the pool. + * The display name need not be unique and can contain any Unicode + * characters up to a maximum length of 1024. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * The last modified time of the pool. + * This is the last time at which the pool level data, such as the + * targetDedicatedNodes or autoScaleSettings, changed. It does not factor + * in node-level changes such as a compute node changing state. + */ + @JsonProperty(value = "properties.lastModified", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastModified; + + /** + * The creation time of the pool. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationTime; + + /** + * The current state of the pool. + * Values are: + * + * Succeeded - The pool is available to run tasks subject to the + * availability of compute nodes. + * Deleting - The user has requested that the pool be deleted, but the + * delete operation has not yet completed. Possible values include: + * 'Succeeded', 'Deleting'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PoolProvisioningState provisioningState; + + /** + * The time at which the pool entered its current state. + */ + @JsonProperty(value = "properties.provisioningStateTransitionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime provisioningStateTransitionTime; + + /** + * Whether the pool is resizing. + * Values are: + * + * Steady - The pool is not resizing. There are no changes to the number of + * nodes in the pool in progress. A pool enters this state when it is + * created and when no operations are being performed on the pool to change + * the number of dedicated nodes. + * Resizing - The pool is resizing; that is, compute nodes are being added + * to or removed from the pool. + * Stopping - The pool was resizing, but the user has requested that the + * resize be stopped, but the stop request has not yet been completed. + * Possible values include: 'Steady', 'Resizing', 'Stopping'. + */ + @JsonProperty(value = "properties.allocationState", access = JsonProperty.Access.WRITE_ONLY) + private AllocationState allocationState; + + /** + * The time at which the pool entered its current allocation state. + */ + @JsonProperty(value = "properties.allocationStateTransitionTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime allocationStateTransitionTime; + + /** + * The size of virtual machines in the pool. All VMs in a pool are the same + * size. + * For information about available sizes of virtual machines for Cloud + * Services pools (pools created with cloudServiceConfiguration), see Sizes + * for Cloud Services + * (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). + * Batch supports all Cloud Services VM sizes except ExtraSmall. For + * information about available VM sizes for pools using images from the + * Virtual Machines Marketplace (pools created with + * virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) + * (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) + * or Sizes for Virtual Machines (Windows) + * (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). + * Batch supports all Azure VM sizes except STANDARD_A0 and those with + * premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + */ + @JsonProperty(value = "properties.vmSize") + private String vmSize; + + /** + * This property describes how the pool nodes will be deployed - using + * Cloud Services or Virtual Machines. + * Using CloudServiceConfiguration specifies that the nodes should be + * creating using Azure Cloud Services (PaaS), while + * VirtualMachineConfiguration uses Azure Virtual Machines (IaaS). + */ + @JsonProperty(value = "properties.deploymentConfiguration") + private DeploymentConfiguration deploymentConfiguration; + + /** + * The number of compute nodes currently in the pool. + */ + @JsonProperty(value = "properties.currentDedicatedNodes", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentDedicatedNodes; + + /** + * The number of low priority compute nodes currently in the pool. + */ + @JsonProperty(value = "properties.currentLowPriorityNodes", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentLowPriorityNodes; + + /** + * Settings which configure the number of nodes in the pool. + */ + @JsonProperty(value = "properties.scaleSettings") + private ScaleSettings scaleSettings; + + /** + * The results and errors from the last execution of the autoscale formula. + * This property is set only if the pool automatically scales, i.e. + * autoScaleSettings are used. + */ + @JsonProperty(value = "properties.autoScaleRun", access = JsonProperty.Access.WRITE_ONLY) + private AutoScaleRun autoScaleRun; + + /** + * Whether the pool permits direct communication between nodes. + * This imposes restrictions on which nodes can be assigned to the pool. + * Enabling this value can reduce the chance of the requested number of + * nodes to be allocated in the pool. If not specified, this value defaults + * to 'Disabled'. Possible values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.interNodeCommunication") + private InterNodeCommunicationState interNodeCommunication; + + /** + * The network configuration for the pool. + */ + @JsonProperty(value = "properties.networkConfiguration") + private NetworkConfiguration networkConfiguration; + + /** + * The maximum number of tasks that can run concurrently on a single + * compute node in the pool. + */ + @JsonProperty(value = "properties.maxTasksPerNode") + private Integer maxTasksPerNode; + + /** + * How tasks are distributed across compute nodes in a pool. + */ + @JsonProperty(value = "properties.taskSchedulingPolicy") + private TaskSchedulingPolicy taskSchedulingPolicy; + + /** + * The list of user accounts to be created on each node in the pool. + */ + @JsonProperty(value = "properties.userAccounts") + private List userAccounts; + + /** + * A list of name-value pairs associated with the pool as metadata. + * The Batch service does not assign any meaning to metadata; it is solely + * for the use of user code. + */ + @JsonProperty(value = "properties.metadata") + private List metadata; + + /** + * A task specified to run on each compute node as it joins the pool. + * In an PATCH (update) operation, this property can be set to an empty + * object to remove the start task from the pool. + */ + @JsonProperty(value = "properties.startTask") + private StartTask startTask; + + /** + * The list of certificates to be installed on each compute node in the + * pool. + * For Windows compute nodes, the Batch service installs the certificates + * to the specified certificate store and location. For Linux compute + * nodes, the certificates are stored in a directory inside the task + * working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR + * is supplied to the task to query for this location. For certificates + * with visibility of 'remoteUser', a 'certs' directory is created in the + * user's home directory (e.g., /home/{user-name}/certs) and certificates + * are placed in that directory. + */ + @JsonProperty(value = "properties.certificates") + private List certificates; + + /** + * The list of application packages to be installed on each compute node in + * the pool. + * Changes to application packages affect all new compute nodes joining the + * pool, but do not affect compute nodes that are already in the pool until + * they are rebooted or reimaged. + */ + @JsonProperty(value = "properties.applicationPackages") + private List applicationPackages; + + /** + * The list of application licenses the Batch service will make available + * on each compute node in the pool. + * The list of application licenses must be a subset of available Batch + * service application licenses. If a license is requested which is not + * supported, pool creation will fail. + */ + @JsonProperty(value = "properties.applicationLicenses") + private List applicationLicenses; + + /** + * Contains details about the current or last completed resize operation. + */ + @JsonProperty(value = "properties.resizeOperationStatus", access = JsonProperty.Access.WRITE_ONLY) + private ResizeOperationStatus resizeOperationStatus; + + /** + * The ETag of the resource, used for concurrency statements. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. + * + * @param displayName the displayName value to set + * @return the PoolInner object itself. + */ + public PoolInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get this is the last time at which the pool level data, such as the targetDedicatedNodes or autoScaleSettings, changed. It does not factor in node-level changes such as a compute node changing state. + * + * @return the lastModified value + */ + public DateTime lastModified() { + return this.lastModified; + } + + /** + * Get the creationTime value. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Get values are: + Succeeded - The pool is available to run tasks subject to the availability of compute nodes. + Deleting - The user has requested that the pool be deleted, but the delete operation has not yet completed. Possible values include: 'Succeeded', 'Deleting'. + * + * @return the provisioningState value + */ + public PoolProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningStateTransitionTime value. + * + * @return the provisioningStateTransitionTime value + */ + public DateTime provisioningStateTransitionTime() { + return this.provisioningStateTransitionTime; + } + + /** + * Get values are: + Steady - The pool is not resizing. There are no changes to the number of nodes in the pool in progress. A pool enters this state when it is created and when no operations are being performed on the pool to change the number of dedicated nodes. + Resizing - The pool is resizing; that is, compute nodes are being added to or removed from the pool. + Stopping - The pool was resizing, but the user has requested that the resize be stopped, but the stop request has not yet been completed. Possible values include: 'Steady', 'Resizing', 'Stopping'. + * + * @return the allocationState value + */ + public AllocationState allocationState() { + return this.allocationState; + } + + /** + * Get the allocationStateTransitionTime value. + * + * @return the allocationStateTransitionTime value + */ + public DateTime allocationStateTransitionTime() { + return this.allocationStateTransitionTime; + } + + /** + * Get for information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + * + * @return the vmSize value + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set for information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (http://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + * + * @param vmSize the vmSize value to set + * @return the PoolInner object itself. + */ + public PoolInner withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS), while VirtualMachineConfiguration uses Azure Virtual Machines (IaaS). + * + * @return the deploymentConfiguration value + */ + public DeploymentConfiguration deploymentConfiguration() { + return this.deploymentConfiguration; + } + + /** + * Set using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS), while VirtualMachineConfiguration uses Azure Virtual Machines (IaaS). + * + * @param deploymentConfiguration the deploymentConfiguration value to set + * @return the PoolInner object itself. + */ + public PoolInner withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) { + this.deploymentConfiguration = deploymentConfiguration; + return this; + } + + /** + * Get the currentDedicatedNodes value. + * + * @return the currentDedicatedNodes value + */ + public Integer currentDedicatedNodes() { + return this.currentDedicatedNodes; + } + + /** + * Get the currentLowPriorityNodes value. + * + * @return the currentLowPriorityNodes value + */ + public Integer currentLowPriorityNodes() { + return this.currentLowPriorityNodes; + } + + /** + * Get the scaleSettings value. + * + * @return the scaleSettings value + */ + public ScaleSettings scaleSettings() { + return this.scaleSettings; + } + + /** + * Set the scaleSettings value. + * + * @param scaleSettings the scaleSettings value to set + * @return the PoolInner object itself. + */ + public PoolInner withScaleSettings(ScaleSettings scaleSettings) { + this.scaleSettings = scaleSettings; + return this; + } + + /** + * Get this property is set only if the pool automatically scales, i.e. autoScaleSettings are used. + * + * @return the autoScaleRun value + */ + public AutoScaleRun autoScaleRun() { + return this.autoScaleRun; + } + + /** + * Get this imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. Possible values include: 'Enabled', 'Disabled'. + * + * @return the interNodeCommunication value + */ + public InterNodeCommunicationState interNodeCommunication() { + return this.interNodeCommunication; + } + + /** + * Set this imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. Possible values include: 'Enabled', 'Disabled'. + * + * @param interNodeCommunication the interNodeCommunication value to set + * @return the PoolInner object itself. + */ + public PoolInner withInterNodeCommunication(InterNodeCommunicationState interNodeCommunication) { + this.interNodeCommunication = interNodeCommunication; + return this; + } + + /** + * Get the networkConfiguration value. + * + * @return the networkConfiguration value + */ + public NetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration value. + * + * @param networkConfiguration the networkConfiguration value to set + * @return the PoolInner object itself. + */ + public PoolInner withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the maxTasksPerNode value. + * + * @return the maxTasksPerNode value + */ + public Integer maxTasksPerNode() { + return this.maxTasksPerNode; + } + + /** + * Set the maxTasksPerNode value. + * + * @param maxTasksPerNode the maxTasksPerNode value to set + * @return the PoolInner object itself. + */ + public PoolInner withMaxTasksPerNode(Integer maxTasksPerNode) { + this.maxTasksPerNode = maxTasksPerNode; + return this; + } + + /** + * Get the taskSchedulingPolicy value. + * + * @return the taskSchedulingPolicy value + */ + public TaskSchedulingPolicy taskSchedulingPolicy() { + return this.taskSchedulingPolicy; + } + + /** + * Set the taskSchedulingPolicy value. + * + * @param taskSchedulingPolicy the taskSchedulingPolicy value to set + * @return the PoolInner object itself. + */ + public PoolInner withTaskSchedulingPolicy(TaskSchedulingPolicy taskSchedulingPolicy) { + this.taskSchedulingPolicy = taskSchedulingPolicy; + return this; + } + + /** + * Get the userAccounts value. + * + * @return the userAccounts value + */ + public List userAccounts() { + return this.userAccounts; + } + + /** + * Set the userAccounts value. + * + * @param userAccounts the userAccounts value to set + * @return the PoolInner object itself. + */ + public PoolInner withUserAccounts(List userAccounts) { + this.userAccounts = userAccounts; + return this; + } + + /** + * Get the Batch service does not assign any meaning to metadata; it is solely for the use of user code. + * + * @return the metadata value + */ + public List metadata() { + return this.metadata; + } + + /** + * Set the Batch service does not assign any meaning to metadata; it is solely for the use of user code. + * + * @param metadata the metadata value to set + * @return the PoolInner object itself. + */ + public PoolInner withMetadata(List metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get in an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. + * + * @return the startTask value + */ + public StartTask startTask() { + return this.startTask; + } + + /** + * Set in an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. + * + * @param startTask the startTask value to set + * @return the PoolInner object itself. + */ + public PoolInner withStartTask(StartTask startTask) { + this.startTask = startTask; + return this; + } + + /** + * Get for Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. + * + * @return the certificates value + */ + public List certificates() { + return this.certificates; + } + + /** + * Set for Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. + * + * @param certificates the certificates value to set + * @return the PoolInner object itself. + */ + public PoolInner withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get changes to application packages affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. + * + * @return the applicationPackages value + */ + public List applicationPackages() { + return this.applicationPackages; + } + + /** + * Set changes to application packages affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. + * + * @param applicationPackages the applicationPackages value to set + * @return the PoolInner object itself. + */ + public PoolInner withApplicationPackages(List applicationPackages) { + this.applicationPackages = applicationPackages; + return this; + } + + /** + * Get the list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. + * + * @return the applicationLicenses value + */ + public List applicationLicenses() { + return this.applicationLicenses; + } + + /** + * Set the list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. + * + * @param applicationLicenses the applicationLicenses value to set + * @return the PoolInner object itself. + */ + public PoolInner withApplicationLicenses(List applicationLicenses) { + this.applicationLicenses = applicationLicenses; + return this; + } + + /** + * Get the resizeOperationStatus value. + * + * @return the resizeOperationStatus value + */ + public ResizeOperationStatus resizeOperationStatus() { + return this.resizeOperationStatus; + } + + /** + * Get the ETag of the resource, used for concurrency statements. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolsImpl.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolsImpl.java new file mode 100644 index 000000000000..2d614ee4b758 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolsImpl.java @@ -0,0 +1,105 @@ +/** + * 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.batch.v2017_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.batch.v2017_09_01.Pools; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.batch.v2017_09_01.Pool; + +class PoolsImpl extends WrapperImpl implements Pools { + private final BatchManager manager; + + PoolsImpl(BatchManager manager) { + super(manager.inner().pools()); + this.manager = manager; + } + + public BatchManager manager() { + return this.manager; + } + + @Override + public PoolImpl define(String name) { + return wrapModel(name); + } + + private PoolImpl wrapModel(PoolInner inner) { + return new PoolImpl(inner, manager()); + } + + private PoolImpl wrapModel(String name) { + return new PoolImpl(name, this.manager()); + } + + @Override + public Observable disableAutoScaleAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.disableAutoScaleAsync(resourceGroupName, accountName, poolName) + .map(new Func1() { + @Override + public Pool call(PoolInner inner) { + return new PoolImpl(inner, manager()); + } + }); + } + + @Override + public Observable stopResizeAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.stopResizeAsync(resourceGroupName, accountName, poolName) + .map(new Func1() { + @Override + public Pool call(PoolInner inner) { + return new PoolImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByBatchAccountAsync(final String resourceGroupName, final String accountName) { + PoolsInner client = this.inner(); + return client.listByBatchAccountAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Pool call(PoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, poolName) + .map(new Func1() { + @Override + public Pool call(PoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String poolName) { + PoolsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, poolName).toCompletable(); + } + +} diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolsInner.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolsInner.java new file mode 100644 index 000000000000..52d1d1676b59 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/PoolsInner.java @@ -0,0 +1,1572 @@ +/** + * 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.batch.v2017_09_01.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.batch.v2017_09_01.PoolCreateHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.PoolDeleteHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.PoolDisableAutoScaleHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.PoolGetHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.PoolStopResizeHeaders; +import com.microsoft.azure.management.batch.v2017_09_01.PoolUpdateHeaders; +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.ServiceResponseWithHeaders; +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 Pools. + */ +public class PoolsInner { + /** The Retrofit service to perform REST calls. */ + private PoolsService service; + /** The service client containing this operation class. */ + private BatchManagementClientImpl client; + + /** + * Initializes an instance of PoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PoolsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(PoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Pools to be + * used by Retrofit to perform actually REST calls. + */ + interface PoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.batch.v2017_09_01.Pools listByBatchAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools") + Observable> listByBatchAccount(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("maxresults") Integer maxresults, @Query("$select") String select, @Query("$filter") String filter, @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.batch.v2017_09_01.Pools create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("subscriptionId") String subscriptionId, @Body PoolInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @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.batch.v2017_09_01.Pools beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}") + Observable> beginCreate(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("subscriptionId") String subscriptionId, @Body PoolInner parameters, @Header("If-Match") String ifMatch, @Header("If-None-Match") String ifNoneMatch, @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.batch.v2017_09_01.Pools update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @Path("subscriptionId") String subscriptionId, @Body PoolInner parameters, @Header("If-Match") String ifMatch, @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.batch.v2017_09_01.Pools delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.batch.v2017_09_01.Pools beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.batch.v2017_09_01.Pools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.batch.v2017_09_01.Pools disableAutoScale" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale") + Observable> disableAutoScale(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.batch.v2017_09_01.Pools stopResize" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize") + Observable> stopResize(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("poolName") String poolName, @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.batch.v2017_09_01.Pools listByBatchAccountNext" }) + @GET + Observable> listByBatchAccountNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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<PoolInner> object if successful. + */ + public PagedList listByBatchAccount(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listByBatchAccountSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @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> listByBatchAccountAsync(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBatchAccountSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PoolInner> object + */ + public Observable> listByBatchAccountAsync(final String resourceGroupName, final String accountName) { + return listByBatchAccountWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PoolInner> object + */ + public Observable>> listByBatchAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listByBatchAccountSinglePageAsync(resourceGroupName, accountName) + .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(listByBatchAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBatchAccountSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final Integer maxresults = null; + final String select = null; + final String filter = null; + return service.listByBatchAccount(resourceGroupName, accountName, this.client.subscriptionId(), maxresults, select, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBatchAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are: + name + properties/allocationState + properties/allocationStateTransitionTime + properties/creationTime + properties/provisioningState + properties/provisioningStateTransitionTime + properties/lastModified + properties/vmSize + properties/interNodeCommunication + properties/scaleSettings/autoScale + properties/scaleSettings/fixedScale + * @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<PoolInner> object if successful. + */ + public PagedList listByBatchAccount(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + ServiceResponse> response = listByBatchAccountSinglePageAsync(resourceGroupName, accountName, maxresults, select, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are: + name + properties/allocationState + properties/allocationStateTransitionTime + properties/creationTime + properties/provisioningState + properties/provisioningStateTransitionTime + properties/lastModified + properties/vmSize + properties/interNodeCommunication + properties/scaleSettings/autoScale + properties/scaleSettings/fixedScale + * @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> listByBatchAccountAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBatchAccountSinglePageAsync(resourceGroupName, accountName, maxresults, select, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are: + name + properties/allocationState + properties/allocationStateTransitionTime + properties/creationTime + properties/provisioningState + properties/provisioningStateTransitionTime + properties/lastModified + properties/vmSize + properties/interNodeCommunication + properties/scaleSettings/autoScale + properties/scaleSettings/fixedScale + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PoolInner> object + */ + public Observable> listByBatchAccountAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + return listByBatchAccountWithServiceResponseAsync(resourceGroupName, accountName, maxresults, select, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + * @param filter OData filter expression. Valid properties for filtering are: + name + properties/allocationState + properties/allocationStateTransitionTime + properties/creationTime + properties/provisioningState + properties/provisioningStateTransitionTime + properties/lastModified + properties/vmSize + properties/interNodeCommunication + properties/scaleSettings/autoScale + properties/scaleSettings/fixedScale + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PoolInner> object + */ + public Observable>> listByBatchAccountWithServiceResponseAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + return listByBatchAccountSinglePageAsync(resourceGroupName, accountName, maxresults, select, 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(listByBatchAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the Batch account. + ServiceResponse> * @param accountName The name of the Batch account. + ServiceResponse> * @param maxresults The maximum number of items to return in the response. + ServiceResponse> * @param select Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. + ServiceResponse> * @param filter OData filter expression. Valid properties for filtering are: + name + properties/allocationState + properties/allocationStateTransitionTime + properties/creationTime + properties/provisioningState + properties/provisioningStateTransitionTime + properties/lastModified + properties/vmSize + properties/interNodeCommunication + properties/scaleSettings/autoScale + properties/scaleSettings/fixedScale + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBatchAccountSinglePageAsync(final String resourceGroupName, final String accountName, final Integer maxresults, final String select, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.listByBatchAccount(resourceGroupName, accountName, this.client.subscriptionId(), maxresults, select, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBatchAccountDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBatchAccountDelegate(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); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @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 PoolInner object if successful. + */ + public PoolInner create(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters).toBlocking().last().body(); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @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 createAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters), serviceCallback); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + Observable> observable = service.create(resourceGroupName, accountName, poolName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), PoolCreateHeaders.class); + } + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @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 PoolInner object if successful. + */ + public PoolInner create(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch, ifNoneMatch).toBlocking().last().body(); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @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 createAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(createWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch) { + return createWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch, ifNoneMatch).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + Observable> observable = service.create(resourceGroupName, accountName, poolName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), PoolCreateHeaders.class); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @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 PoolInner object if successful. + */ + public PoolInner beginCreate(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters).toBlocking().single().body(); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @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 beginCreateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters), serviceCallback); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + final String ifMatch = null; + final String ifNoneMatch = null; + return service.beginCreate(resourceGroupName, accountName, poolName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @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 PoolInner object if successful. + */ + public PoolInner beginCreate(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch, ifNoneMatch).toBlocking().single().body(); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @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 beginCreateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch, ifNoneMatch), serviceCallback); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch, ifNoneMatch).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Creates a new pool inside the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Additional parameters for pool creation. + * @param ifMatch The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. + * @param ifNoneMatch Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, String ifNoneMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.beginCreate(resourceGroupName, accountName, poolName, this.client.subscriptionId(), parameters, ifMatch, ifNoneMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PoolCreateHeaders.class); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @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 PoolInner object if successful. + */ + public PoolInner update(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @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 updateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters), serviceCallback); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + final String ifMatch = null; + return service.update(resourceGroupName, accountName, poolName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @param ifMatch The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @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 PoolInner object if successful. + */ + public PoolInner update(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch).toBlocking().single().body(); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @param ifMatch The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @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 updateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch), serviceCallback); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @param ifMatch The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, poolName, parameters, ifMatch).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Updates the properties of an existing pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @param parameters Pool properties that should be updated. Properties that are supplied will be updated, any property not supplied will be unchanged. + * @param ifMatch The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName, PoolInner parameters, String ifMatch) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.update(resourceGroupName, accountName, poolName, this.client.subscriptionId(), parameters, ifMatch, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PoolUpdateHeaders.class); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 accountName, String poolName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().last().body(); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String poolName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, accountName, poolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), PoolDeleteHeaders.class); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 beginDelete(String resourceGroupName, String accountName, String poolName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 beginDeleteAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName, String poolName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, accountName, poolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PoolDeleteHeaders.class); + } + + /** + * Gets information about the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 PoolInner object if successful. + */ + public PoolInner get(String resourceGroupName, String accountName, String poolName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Gets information about the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(getWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Gets information about the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String poolName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Gets information about the specified pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + 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.get(resourceGroupName, accountName, poolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PoolGetHeaders.class); + } + + /** + * Disables automatic scaling for a pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 PoolInner object if successful. + */ + public PoolInner disableAutoScale(String resourceGroupName, String accountName, String poolName) { + return disableAutoScaleWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Disables automatic scaling for a pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 disableAutoScaleAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(disableAutoScaleWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Disables automatic scaling for a pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable disableAutoScaleAsync(String resourceGroupName, String accountName, String poolName) { + return disableAutoScaleWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Disables automatic scaling for a pool. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> disableAutoScaleWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + 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.disableAutoScale(resourceGroupName, accountName, poolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = disableAutoScaleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders disableAutoScaleDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PoolDisableAutoScaleHeaders.class); + } + + /** + * Stops an ongoing resize operation on the pool. + * This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 PoolInner object if successful. + */ + public PoolInner stopResize(String resourceGroupName, String accountName, String poolName) { + return stopResizeWithServiceResponseAsync(resourceGroupName, accountName, poolName).toBlocking().single().body(); + } + + /** + * Stops an ongoing resize operation on the pool. + * This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @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 stopResizeAsync(String resourceGroupName, String accountName, String poolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(stopResizeWithServiceResponseAsync(resourceGroupName, accountName, poolName), serviceCallback); + } + + /** + * Stops an ongoing resize operation on the pool. + * This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable stopResizeAsync(String resourceGroupName, String accountName, String poolName) { + return stopResizeWithServiceResponseAsync(resourceGroupName, accountName, poolName).map(new Func1, PoolInner>() { + @Override + public PoolInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Stops an ongoing resize operation on the pool. + * This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param poolName The pool name. This must be unique within the account. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PoolInner object + */ + public Observable> stopResizeWithServiceResponseAsync(String resourceGroupName, String accountName, String poolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (poolName == null) { + throw new IllegalArgumentException("Parameter poolName is required and cannot be null."); + } + 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.stopResize(resourceGroupName, accountName, poolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = stopResizeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders stopResizeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, PoolStopResizeHeaders.class); + } + + /** + * Lists all of the pools in the specified account. + * + * @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<PoolInner> object if successful. + */ + public PagedList listByBatchAccountNext(final String nextPageLink) { + ServiceResponse> response = listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the pools in the specified account. + * + * @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> listByBatchAccountNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByBatchAccountNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the pools in the specified account. + * + * @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<PoolInner> object + */ + public Observable> listByBatchAccountNextAsync(final String nextPageLink) { + return listByBatchAccountNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + * @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<PoolInner> object + */ + public Observable>> listByBatchAccountNextWithServiceResponseAsync(final String nextPageLink) { + return listByBatchAccountNextSinglePageAsync(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(listByBatchAccountNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the pools in the specified account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByBatchAccountNextSinglePageAsync(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.listByBatchAccountNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByBatchAccountNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByBatchAccountNextDelegate(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/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/package-info.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/implementation/package-info.java new file mode 100644 index 000000000000..8e0e50942755 --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/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 BatchManagementClient. + */ +package com.microsoft.azure.management.batch.v2017_09_01.implementation; diff --git a/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/package-info.java b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/package-info.java new file mode 100644 index 000000000000..1c3f0185041b --- /dev/null +++ b/batch/resource-manager/v2017_09_01/src/main/java/com/microsoft/azure/management/batch/v2017_09_01/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 BatchManagementClient. + */ +package com.microsoft.azure.management.batch.v2017_09_01;