diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java deleted file mode 100644 index a6ae3df33433..000000000000 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * 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; - -import org.joda.time.DateTime; - -/** - * Contains information about an application package. - */ -public class ApplicationPackage { - /** - * The version of the application package. - */ - private String version; - - /** - * The current state of the application package. Possible values include: - * 'pending', 'active', 'unmapped'. - */ - private PackageState state; - - /** - * The format of the application package, if the package has been - * activated. - */ - private String format; - - /** - * The time at which the package was last activated, if the package is - * active. - */ - private DateTime lastActivationTime; - - /** - * Get the version value. - * - * @return the version value - */ - public String version() { - return this.version; - } - - /** - * Set the version value. - * - * @param version the version value to set - * @return the ApplicationPackage object itself. - */ - public ApplicationPackage withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the state value. - * - * @return the state value - */ - public PackageState state() { - return this.state; - } - - /** - * Set the state value. - * - * @param state the state value to set - * @return the ApplicationPackage object itself. - */ - public ApplicationPackage withState(PackageState state) { - this.state = state; - return this; - } - - /** - * Get the format value. - * - * @return the format value - */ - public String format() { - return this.format; - } - - /** - * Set the format value. - * - * @param format the format value to set - * @return the ApplicationPackage object itself. - */ - public ApplicationPackage withFormat(String format) { - this.format = format; - return this; - } - - /** - * Get the lastActivationTime value. - * - * @return the lastActivationTime value - */ - public DateTime lastActivationTime() { - return this.lastActivationTime; - } - - /** - * Set the lastActivationTime value. - * - * @param lastActivationTime the lastActivationTime value to set - * @return the ApplicationPackage object itself. - */ - public ApplicationPackage withLastActivationTime(DateTime lastActivationTime) { - this.lastActivationTime = lastActivationTime; - return this; - } - -} diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccount.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccount.java index 028b6278e3d1..3c56814977ef 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccount.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/BatchAccount.java @@ -9,7 +9,7 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.apigeneration.LangMethodDefinition; import com.microsoft.azure.management.apigeneration.LangMethodDefinition.LangMethodType; -import com.microsoft.azure.management.batch.implementation.AccountResourceInner; +import com.microsoft.azure.management.batch.implementation.BatchAccountInner; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource; import com.microsoft.azure.management.resources.fluentcore.model.Appliable; @@ -27,13 +27,13 @@ public interface BatchAccount extends GroupableResource, Refreshable, Updatable, - Wrapper { + Wrapper { /** * @return the provisioned state of the resource. Possible values include: * 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled' */ - AccountProvisioningState provisioningState(); + ProvisioningState provisioningState(); /** * @return Get the accountEndpoint value. diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/AccountProvisioningState.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ProvisioningState.java similarity index 66% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/AccountProvisioningState.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ProvisioningState.java index fd7d79277281..6b5f2877dfa7 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/AccountProvisioningState.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ProvisioningState.java @@ -12,9 +12,9 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Defines values for AccountProvisioningState. + * Defines values for ProvisioningState. */ -public enum AccountProvisioningState { +public enum ProvisioningState { /** Enum value Invalid. */ INVALID("Invalid"), @@ -33,23 +33,23 @@ public enum AccountProvisioningState { /** Enum value Cancelled. */ CANCELLED("Cancelled"); - /** The actual serialized value for a AccountProvisioningState instance. */ + /** The actual serialized value for a ProvisioningState instance. */ private String value; - AccountProvisioningState(String value) { + ProvisioningState(String value) { this.value = value; } /** - * Parses a serialized value to a AccountProvisioningState instance. + * Parses a serialized value to a ProvisioningState instance. * * @param value the serialized value to parse. - * @return the parsed AccountProvisioningState object, or null if unable to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. */ @JsonCreator - public static AccountProvisioningState fromString(String value) { - AccountProvisioningState[] items = AccountProvisioningState.values(); - for (AccountProvisioningState item : items) { + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AddApplicationPackageResultInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AddApplicationPackageResultInner.java deleted file mode 100644 index 3ec9cd772a20..000000000000 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AddApplicationPackageResultInner.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * 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.implementation; - -import org.joda.time.DateTime; - -/** - * Response to an ApplicationOperations.AddApplicationPackage request. - */ -public class AddApplicationPackageResultInner { - /** - * The id of the application. - */ - private String id; - - /** - * The version of the application. - */ - private String version; - - /** - * The URL to which the application package binary file should be uploaded. - */ - private String storageUrl; - - /** - * The UTC time at which the storage URL will expire. - */ - private DateTime storageUrlExpiry; - - /** - * 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 AddApplicationPackageResultInner object itself. - */ - public AddApplicationPackageResultInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the version value. - * - * @return the version value - */ - public String version() { - return this.version; - } - - /** - * Set the version value. - * - * @param version the version value to set - * @return the AddApplicationPackageResultInner object itself. - */ - public AddApplicationPackageResultInner withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the storageUrl value. - * - * @return the storageUrl value - */ - public String storageUrl() { - return this.storageUrl; - } - - /** - * Set the storageUrl value. - * - * @param storageUrl the storageUrl value to set - * @return the AddApplicationPackageResultInner object itself. - */ - public AddApplicationPackageResultInner withStorageUrl(String storageUrl) { - this.storageUrl = storageUrl; - return this; - } - - /** - * Get the storageUrlExpiry value. - * - * @return the storageUrlExpiry value - */ - public DateTime storageUrlExpiry() { - return this.storageUrlExpiry; - } - - /** - * Set the storageUrlExpiry value. - * - * @param storageUrlExpiry the storageUrlExpiry value to set - * @return the AddApplicationPackageResultInner object itself. - */ - public AddApplicationPackageResultInner withStorageUrlExpiry(DateTime storageUrlExpiry) { - this.storageUrlExpiry = storageUrlExpiry; - return this; - } - -} diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationInner.java index 142980fad119..fad0450ad8cb 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationInner.java @@ -9,7 +9,6 @@ package com.microsoft.azure.management.batch.implementation; import java.util.List; -import com.microsoft.azure.management.batch.ApplicationPackage; /** * Contains information about an application in a Batch account. @@ -28,7 +27,7 @@ public class ApplicationInner { /** * The list of packages under this application. */ - private List packages; + private List packages; /** * A value indicating whether packages within the application may be @@ -87,7 +86,7 @@ public ApplicationInner withDisplayName(String displayName) { * * @return the packages value */ - public List packages() { + public List packages() { return this.packages; } @@ -97,7 +96,7 @@ public List packages() { * @param packages the packages value to set * @return the ApplicationInner object itself. */ - public ApplicationInner withPackages(List packages) { + public ApplicationInner withPackages(List packages) { this.packages = packages; return this; } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/GetApplicationPackageResultInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationPackageInner.java similarity index 75% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/GetApplicationPackageResultInner.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationPackageInner.java index ca023a5e0cde..9b5f7d9f51b3 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/GetApplicationPackageResultInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationPackageInner.java @@ -12,9 +12,10 @@ import org.joda.time.DateTime; /** - * Response to an ApplicationOperations.GetApplicationPackage request. + * An application package which represents a particular version of an + * application. */ -public class GetApplicationPackageResultInner { +public class ApplicationPackageInner { /** * The id of the application. */ @@ -65,9 +66,9 @@ public String id() { * Set the id value. * * @param id the id value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withId(String id) { + public ApplicationPackageInner withId(String id) { this.id = id; return this; } @@ -85,9 +86,9 @@ public String version() { * Set the version value. * * @param version the version value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withVersion(String version) { + public ApplicationPackageInner withVersion(String version) { this.version = version; return this; } @@ -105,9 +106,9 @@ public PackageState state() { * Set the state value. * * @param state the state value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withState(PackageState state) { + public ApplicationPackageInner withState(PackageState state) { this.state = state; return this; } @@ -125,9 +126,9 @@ public String format() { * Set the format value. * * @param format the format value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withFormat(String format) { + public ApplicationPackageInner withFormat(String format) { this.format = format; return this; } @@ -145,9 +146,9 @@ public String storageUrl() { * Set the storageUrl value. * * @param storageUrl the storageUrl value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withStorageUrl(String storageUrl) { + public ApplicationPackageInner withStorageUrl(String storageUrl) { this.storageUrl = storageUrl; return this; } @@ -165,9 +166,9 @@ public DateTime storageUrlExpiry() { * Set the storageUrlExpiry value. * * @param storageUrlExpiry the storageUrlExpiry value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withStorageUrlExpiry(DateTime storageUrlExpiry) { + public ApplicationPackageInner withStorageUrlExpiry(DateTime storageUrlExpiry) { this.storageUrlExpiry = storageUrlExpiry; return this; } @@ -185,9 +186,9 @@ public DateTime lastActivationTime() { * Set the lastActivationTime value. * * @param lastActivationTime the lastActivationTime value to set - * @return the GetApplicationPackageResultInner object itself. + * @return the ApplicationPackageInner object itself. */ - public GetApplicationPackageResultInner withLastActivationTime(DateTime lastActivationTime) { + public ApplicationPackageInner withLastActivationTime(DateTime lastActivationTime) { this.lastActivationTime = lastActivationTime; return this; } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationPackagesInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationPackagesInner.java new file mode 100644 index 000000000000..7faeb969c7fc --- /dev/null +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationPackagesInner.java @@ -0,0 +1,459 @@ +/** + * 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.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.batch.ActivateApplicationPackageParameters; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +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 final 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") + @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") + @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") + @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") + @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. + */ + public void activate(String resourceGroupName, String accountName, String applicationId, String version, String format) { + activateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version, format).toBlocking().single().getBody(); + } + + /** + * 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. + * @return the {@link ServiceCall} object + */ + public ServiceCall activateAsync(String resourceGroupName, String accountName, String applicationId, String version, String format, final ServiceCallback serviceCallback) { + return ServiceCall.create(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. + * @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.getBody(); + } + }); + } + + /** + * 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. + * @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 new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(204, new TypeToken() { }.getType()) + .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. + * @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().getBody(); + } + + /** + * 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. + * @return the {@link ServiceCall} object + */ + public ServiceCall createAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { + return ServiceCall.create(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. + * @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.getBody(); + } + }); + } + + /** + * 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. + * @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 new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .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. + */ + public void delete(String resourceGroupName, String accountName, String applicationId, String version) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); + } + + /** + * 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. + * @return the {@link ServiceCall} object + */ + public ServiceCall deleteAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { + return ServiceCall.create(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. + * @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.getBody(); + } + }); + } + + /** + * 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. + * @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 new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(204, new TypeToken() { }.getType()) + .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. + * @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().getBody(); + } + + /** + * 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. + * @return the {@link ServiceCall} object + */ + public ServiceCall getAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { + return ServiceCall.create(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. + * @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.getBody(); + } + }); + } + + /** + * 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. + * @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 new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java index 3859973a440c..17ef9bdfc889 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java @@ -14,7 +14,6 @@ import com.microsoft.azure.AzureServiceResponseBuilder; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.batch.ActivateApplicationPackageParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCall; @@ -31,7 +30,6 @@ 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.Response; @@ -64,37 +62,21 @@ public ApplicationsInner(Retrofit retrofit, BatchManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface ApplicationsService { - @Headers("Content-Type: application/json; charset=utf-8") - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{id}/versions/{version}/activate") - Observable> activateApplicationPackage(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("id") String id, @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") @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}") - Observable> addApplication(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("subscriptionId") String subscriptionId, @Body AddApplicationParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("subscriptionId") String subscriptionId, @Body AddApplicationParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers("Content-Type: application/json; charset=utf-8") @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}", method = "DELETE", hasBody = true) - Observable> deleteApplication(@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); + 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") @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}") - Observable> getApplication(@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); + 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") @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}") - Observable> updateApplication(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("subscriptionId") String subscriptionId, @Body UpdateApplicationParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - @Headers("Content-Type: application/json; charset=utf-8") - @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}") - Observable> addApplicationPackage(@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") - @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}", method = "DELETE", hasBody = true) - Observable> deleteApplicationPackage(@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") - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}") - Observable> getApplicationPackage(@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); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("applicationId") String applicationId, @Path("subscriptionId") String subscriptionId, @Body UpdateApplicationParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers("Content-Type: application/json; charset=utf-8") @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications") @@ -106,107 +88,6 @@ interface ApplicationsService { } - /** - * 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 id The id of the application. - * @param version The version of the application to activate. - * @param format The format of the application package binary file. - */ - public void activateApplicationPackage(String resourceGroupName, String accountName, String id, String version, String format) { - activateApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, id, version, format).toBlocking().single().getBody(); - } - - /** - * 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 id 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. - * @return the {@link ServiceCall} object - */ - public ServiceCall activateApplicationPackageAsync(String resourceGroupName, String accountName, String id, String version, String format, final ServiceCallback serviceCallback) { - return ServiceCall.create(activateApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, id, 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 id The id of the application. - * @param version The version of the application to activate. - * @param format The format of the application package binary file. - * @return the {@link ServiceResponse} object if successful. - */ - public Observable activateApplicationPackageAsync(String resourceGroupName, String accountName, String id, String version, String format) { - return activateApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, id, version, format).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.getBody(); - } - }); - } - - /** - * 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 id The id of the application. - * @param version The version of the application to activate. - * @param format The format of the application package binary file. - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> activateApplicationPackageWithServiceResponseAsync(String resourceGroupName, String accountName, String id, 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 (id == null) { - throw new IllegalArgumentException("Parameter id 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.activateApplicationPackage(resourceGroupName, accountName, id, 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 = activateApplicationPackageDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse activateApplicationPackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(204, new TypeToken() { }.getType()) - .build(response); - } - /** * Adds an application to the specified Batch account. * @@ -215,8 +96,8 @@ private ServiceResponse activateApplicationPackageDelegate(Response addApplicationAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + public ServiceCall createAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceCall.create(createWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); } /** @@ -240,8 +121,8 @@ public ServiceCall addApplicationAsync(String resourceGroupNam * @param applicationId The id of the application. * @return the observable to the ApplicationInner object */ - public Observable addApplicationAsync(String resourceGroupName, String accountName, String applicationId) { - return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, ApplicationInner>() { + 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.getBody(); @@ -257,7 +138,7 @@ public ApplicationInner call(ServiceResponse response) { * @param applicationId The id of the application. * @return the observable to the ApplicationInner object */ - public Observable> addApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -274,12 +155,12 @@ public Observable> addApplicationWithServiceRe throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final AddApplicationParametersInner parameters = null; - return service.addApplication(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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 = addApplicationDelegate(response); + ServiceResponse clientResponse = createDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -297,8 +178,8 @@ public Observable> call(Response * @param parameters The parameters for the request. * @return the ApplicationInner object if successful. */ - public ApplicationInner addApplication(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { - return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single().getBody(); + public ApplicationInner create(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single().getBody(); } /** @@ -311,8 +192,8 @@ public ApplicationInner addApplication(String resourceGroupName, String accountN * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall addApplicationAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + public ServiceCall createAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceCall.create(createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); } /** @@ -324,8 +205,8 @@ public ServiceCall addApplicationAsync(String resourceGroupNam * @param parameters The parameters for the request. * @return the observable to the ApplicationInner object */ - public Observable addApplicationAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { - return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, ApplicationInner>() { + public Observable createAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, ApplicationInner>() { @Override public ApplicationInner call(ServiceResponse response) { return response.getBody(); @@ -342,7 +223,7 @@ public ApplicationInner call(ServiceResponse response) { * @param parameters The parameters for the request. * @return the observable to the ApplicationInner object */ - public Observable> addApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -359,12 +240,12 @@ public Observable> addApplicationWithServiceRe throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(parameters); - return service.addApplication(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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 = addApplicationDelegate(response); + ServiceResponse clientResponse = createDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -373,7 +254,7 @@ public Observable> call(Response }); } - private ServiceResponse addApplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse createDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.mapperAdapter()) .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -387,8 +268,8 @@ private ServiceResponse addApplicationDelegate(Response deleteApplicationAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + public ServiceCall deleteAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); } /** @@ -412,8 +293,8 @@ public ServiceCall deleteApplicationAsync(String resourceGroupName, String * @param applicationId The id of the application. * @return the {@link ServiceResponse} object if successful. */ - public Observable deleteApplicationAsync(String resourceGroupName, String accountName, String applicationId) { - return deleteApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, Void>() { + 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.getBody(); @@ -429,7 +310,7 @@ public Void call(ServiceResponse response) { * @param applicationId The id of the application. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -445,12 +326,12 @@ public Observable> deleteApplicationWithServiceResponseAsy if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.deleteApplication(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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 = deleteApplicationDelegate(response); + ServiceResponse clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -459,7 +340,7 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteApplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.mapperAdapter()) .register(204, new TypeToken() { }.getType()) .build(response); @@ -473,8 +354,8 @@ private ServiceResponse deleteApplicationDelegate(Response r * @param applicationId The id of the application. * @return the ApplicationInner object if successful. */ - public ApplicationInner getApplication(String resourceGroupName, String accountName, String applicationId) { - return getApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().getBody(); + public ApplicationInner get(String resourceGroupName, String accountName, String applicationId) { + return getWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().getBody(); } /** @@ -486,8 +367,8 @@ public ApplicationInner getApplication(String resourceGroupName, String accountN * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall getApplicationAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + public ServiceCall getAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); } /** @@ -498,8 +379,8 @@ public ServiceCall getApplicationAsync(String resourceGroupNam * @param applicationId The id of the application. * @return the observable to the ApplicationInner object */ - public Observable getApplicationAsync(String resourceGroupName, String accountName, String applicationId) { - return getApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, ApplicationInner>() { + 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.getBody(); @@ -515,7 +396,7 @@ public ApplicationInner call(ServiceResponse response) { * @param applicationId The id of the application. * @return the observable to the ApplicationInner object */ - public Observable> getApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -531,12 +412,12 @@ public Observable> getApplicationWithServiceRe if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.getApplication(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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 = getApplicationDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -545,7 +426,7 @@ public Observable> call(Response }); } - private ServiceResponse getApplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.mapperAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -560,8 +441,8 @@ private ServiceResponse getApplicationDelegate(Response updateApplicationAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + public ServiceCall updateAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters, final ServiceCallback serviceCallback) { + return ServiceCall.create(updateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); } /** @@ -587,8 +468,8 @@ public ServiceCall updateApplicationAsync(String resourceGroupName, String * @param parameters The parameters for the request. * @return the {@link ServiceResponse} object if successful. */ - public Observable updateApplicationAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { - return updateApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, Void>() { + public Observable updateAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.getBody(); @@ -605,7 +486,7 @@ public Void call(ServiceResponse response) { * @param parameters The parameters for the request. * @return the {@link ServiceResponse} object if successful. */ - public Observable> updateApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -625,12 +506,12 @@ public Observable> updateApplicationWithServiceResponseAsy throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(parameters); - return service.updateApplication(resourceGroupName, accountName, applicationId, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + 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 = updateApplicationDelegate(response); + ServiceResponse clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -639,292 +520,12 @@ public Observable> call(Response response) { }); } - private ServiceResponse updateApplicationDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return new AzureServiceResponseBuilder(this.client.mapperAdapter()) .register(204, new TypeToken() { }.getType()) .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. - * @return the AddApplicationPackageResultInner object if successful. - */ - public AddApplicationPackageResultInner addApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) { - return addApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); - } - - /** - * 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. - * @return the {@link ServiceCall} object - */ - public ServiceCall addApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(addApplicationPackageWithServiceResponseAsync(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. - * @return the observable to the AddApplicationPackageResultInner object - */ - public Observable addApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { - return addApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, AddApplicationPackageResultInner>() { - @Override - public AddApplicationPackageResultInner call(ServiceResponse response) { - return response.getBody(); - } - }); - } - - /** - * 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. - * @return the observable to the AddApplicationPackageResultInner object - */ - public Observable> addApplicationPackageWithServiceResponseAsync(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.addApplicationPackage(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 = addApplicationPackageDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse addApplicationPackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .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. - */ - public void deleteApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) { - deleteApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); - } - - /** - * 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. - * @return the {@link ServiceCall} object - */ - public ServiceCall deleteApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteApplicationPackageWithServiceResponseAsync(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. - * @return the {@link ServiceResponse} object if successful. - */ - public Observable deleteApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { - return deleteApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, Void>() { - @Override - public Void call(ServiceResponse response) { - return response.getBody(); - } - }); - } - - /** - * 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. - * @return the {@link ServiceResponse} object if successful. - */ - public Observable> deleteApplicationPackageWithServiceResponseAsync(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.deleteApplicationPackage(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 = deleteApplicationPackageDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse deleteApplicationPackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(204, new TypeToken() { }.getType()) - .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. - * @return the GetApplicationPackageResultInner object if successful. - */ - public GetApplicationPackageResultInner getApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) { - return getApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); - } - - /** - * 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. - * @return the {@link ServiceCall} object - */ - public ServiceCall getApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(getApplicationPackageWithServiceResponseAsync(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. - * @return the observable to the GetApplicationPackageResultInner object - */ - public Observable getApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { - return getApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, GetApplicationPackageResultInner>() { - @Override - public GetApplicationPackageResultInner call(ServiceResponse response) { - return response.getBody(); - } - }); - } - - /** - * 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. - * @return the observable to the GetApplicationPackageResultInner object - */ - public Observable> getApplicationPackageWithServiceResponseAsync(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.getApplicationPackage(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 = getApplicationPackageDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse getApplicationPackageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Lists all of the applications in the specified account. * diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountCreateParametersInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountCreateParametersInner.java index 702fd0235d87..d3e759171e30 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountCreateParametersInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountCreateParametersInner.java @@ -19,8 +19,9 @@ @JsonFlatten public class BatchAccountCreateParametersInner { /** - * The region in which the account is created. + * The region in which to create the account. */ + @JsonProperty(required = true) private String location; /** diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountImpl.java index da0b1b5f6499..ca751ed20261 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountImpl.java @@ -1,12 +1,12 @@ package com.microsoft.azure.management.batch.implementation; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.batch.AccountKeyType; -import com.microsoft.azure.management.batch.AccountProvisioningState; import com.microsoft.azure.management.batch.AutoStorageBaseProperties; import com.microsoft.azure.management.batch.AutoStorageProperties; import com.microsoft.azure.management.batch.BatchAccount; import com.microsoft.azure.management.batch.BatchAccountKeys; +import com.microsoft.azure.management.batch.ProvisioningState; +import com.microsoft.azure.management.batch.AccountKeyType; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; import com.microsoft.azure.management.storage.StorageAccount; @@ -22,21 +22,21 @@ public class BatchAccountImpl extends GroupableResourceImpl< BatchAccount, - AccountResourceInner, + BatchAccountInner, BatchAccountImpl, BatchManager> implements BatchAccount, BatchAccount.Definition, BatchAccount.Update { - private final AccountsInner innerCollection; + private final BatchAccountsInner innerCollection; private final StorageManager storageManager; private String creatableStorageAccountKey; private StorageAccount existingStorageAccountToAssociate; private BatchAccountKeys cachedKeys; - protected BatchAccountImpl(String name, AccountResourceInner innerObject, AccountsInner innerCollection, BatchManager manager, final StorageManager storageManager) { + protected BatchAccountImpl(String name, BatchAccountInner innerObject, BatchAccountsInner innerCollection, BatchManager manager, final StorageManager storageManager) { super(name, innerObject, manager); this.innerCollection = innerCollection; this.storageManager = storageManager; @@ -44,7 +44,7 @@ protected BatchAccountImpl(String name, AccountResourceInner innerObject, Accoun @Override public BatchAccount refresh() { - AccountResourceInner response = + BatchAccountInner response = this.innerCollection.get(this.resourceGroupName(), this.name()); this.setInner(response); return this; @@ -68,12 +68,12 @@ public Observable createResourceAsync() { batchAccountCreateParametersInner.withTags(this.inner().getTags()); return this.innerCollection.createAsync(this.resourceGroupName(), this.name(), batchAccountCreateParametersInner) - .map(new Func1() { + .map(new Func1() { @Override - public BatchAccount call(AccountResourceInner accountResourceInner) { + public BatchAccount call(BatchAccountInner batchAccountInner) { self.creatableStorageAccountKey = null; self.existingStorageAccountToAssociate = null; - setInner(accountResourceInner); + setInner(batchAccountInner); return self; } @@ -99,10 +99,10 @@ public Observable applyUpdateAsync() { batchAccountUpdateParametersInner.withTags(self.inner().getTags()); return self.innerCollection.updateAsync(self.resourceGroupName(), self.name(), batchAccountUpdateParametersInner) - .map(new Func1, BatchAccount>() { + .map(new Func1, batchAccount>() { @Override - public BatchAccount call(ServiceResponse accountResourceInner) { - setInner(accountResourceInner.getBody()); + public BatchAccount call(ServiceResponse batchAccount) { + setInner(BatchAccountInner.getBody()); return self; } }); @@ -110,7 +110,7 @@ public BatchAccount call(ServiceResponse accountResourceIn } @Override - public AccountProvisioningState provisioningState() { + public ProvisioningState provisioningState() { return this.inner().provisioningState(); } @@ -150,7 +150,7 @@ public BatchAccountKeys keys() { @Override public BatchAccountKeys refreshKeys() { - BatchAccountListKeyResultInner keys = this.innerCollection.listKeys(this.resourceGroupName(), this.name()); + BatchAccountKeysInner keys = this.innerCollection.getKeys(this.resourceGroupName(), this.name()); cachedKeys = new BatchAccountKeys(keys.primary(), keys.secondary()); return cachedKeys; @@ -158,7 +158,7 @@ public BatchAccountKeys refreshKeys() { @Override public BatchAccountKeys regenerateKeys(AccountKeyType keyType) { - BatchAccountRegenerateKeyResultInner keys = this.innerCollection.regenerateKey(this.resourceGroupName(), this.name(), keyType); + BatchAccountKeysInner keys = this.innerCollection.regenerateKey(this.resourceGroupName(), this.name(), keyType); cachedKeys = new BatchAccountKeys(keys.primary(), keys.secondary()); return cachedKeys; diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountResourceInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountInner.java similarity index 74% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountResourceInner.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountInner.java index 744264a98cb2..c1c6346e822b 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountResourceInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountInner.java @@ -8,7 +8,7 @@ package com.microsoft.azure.management.batch.implementation; -import com.microsoft.azure.management.batch.AccountProvisioningState; +import com.microsoft.azure.management.batch.ProvisioningState; import com.microsoft.azure.management.batch.AutoStorageProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -18,11 +18,11 @@ * Contains information about an Azure Batch account. */ @JsonFlatten -public class AccountResourceInner extends Resource { +public class BatchAccountInner extends Resource { /** * The endpoint used by this account to interact with the Batch services. */ - @JsonProperty(value = "properties.accountEndpoint") + @JsonProperty(value = "properties.accountEndpoint", access = JsonProperty.Access.WRITE_ONLY) private String accountEndpoint; /** @@ -30,7 +30,7 @@ public class AccountResourceInner extends Resource { * 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled'. */ @JsonProperty(value = "properties.provisioningState") - private AccountProvisioningState provisioningState; + private ProvisioningState provisioningState; /** * The properties and status of any auto storage account associated with @@ -66,23 +66,12 @@ public String accountEndpoint() { return this.accountEndpoint; } - /** - * Set the accountEndpoint value. - * - * @param accountEndpoint the accountEndpoint value to set - * @return the AccountResourceInner object itself. - */ - public AccountResourceInner withAccountEndpoint(String accountEndpoint) { - this.accountEndpoint = accountEndpoint; - return this; - } - /** * Get the provisioningState value. * * @return the provisioningState value */ - public AccountProvisioningState provisioningState() { + public ProvisioningState provisioningState() { return this.provisioningState; } @@ -90,9 +79,9 @@ public AccountProvisioningState provisioningState() { * Set the provisioningState value. * * @param provisioningState the provisioningState value to set - * @return the AccountResourceInner object itself. + * @return the BatchAccountInner object itself. */ - public AccountResourceInner withProvisioningState(AccountProvisioningState provisioningState) { + public BatchAccountInner withProvisioningState(ProvisioningState provisioningState) { this.provisioningState = provisioningState; return this; } @@ -110,9 +99,9 @@ public AutoStorageProperties autoStorage() { * Set the autoStorage value. * * @param autoStorage the autoStorage value to set - * @return the AccountResourceInner object itself. + * @return the BatchAccountInner object itself. */ - public AccountResourceInner withAutoStorage(AutoStorageProperties autoStorage) { + public BatchAccountInner withAutoStorage(AutoStorageProperties autoStorage) { this.autoStorage = autoStorage; return this; } @@ -130,9 +119,9 @@ public int coreQuota() { * Set the coreQuota value. * * @param coreQuota the coreQuota value to set - * @return the AccountResourceInner object itself. + * @return the BatchAccountInner object itself. */ - public AccountResourceInner withCoreQuota(int coreQuota) { + public BatchAccountInner withCoreQuota(int coreQuota) { this.coreQuota = coreQuota; return this; } @@ -150,9 +139,9 @@ public int poolQuota() { * Set the poolQuota value. * * @param poolQuota the poolQuota value to set - * @return the AccountResourceInner object itself. + * @return the BatchAccountInner object itself. */ - public AccountResourceInner withPoolQuota(int poolQuota) { + public BatchAccountInner withPoolQuota(int poolQuota) { this.poolQuota = poolQuota; return this; } @@ -170,9 +159,9 @@ public int activeJobAndJobScheduleQuota() { * Set the activeJobAndJobScheduleQuota value. * * @param activeJobAndJobScheduleQuota the activeJobAndJobScheduleQuota value to set - * @return the AccountResourceInner object itself. + * @return the BatchAccountInner object itself. */ - public AccountResourceInner withActiveJobAndJobScheduleQuota(int activeJobAndJobScheduleQuota) { + public BatchAccountInner withActiveJobAndJobScheduleQuota(int activeJobAndJobScheduleQuota) { this.activeJobAndJobScheduleQuota = activeJobAndJobScheduleQuota; return this; } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountListKeyResultInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountKeysInner.java similarity index 75% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountListKeyResultInner.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountKeysInner.java index 3e0e2404d1ae..b56d243ffc80 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountListKeyResultInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountKeysInner.java @@ -10,9 +10,9 @@ /** - * Values returned by the GetKeys operation. + * A set of Azure Batch account keys. */ -public class BatchAccountListKeyResultInner { +public class BatchAccountKeysInner { /** * The primary key associated with the account. */ @@ -36,9 +36,9 @@ public String primary() { * Set the primary value. * * @param primary the primary value to set - * @return the BatchAccountListKeyResultInner object itself. + * @return the BatchAccountKeysInner object itself. */ - public BatchAccountListKeyResultInner withPrimary(String primary) { + public BatchAccountKeysInner withPrimary(String primary) { this.primary = primary; return this; } @@ -56,9 +56,9 @@ public String secondary() { * Set the secondary value. * * @param secondary the secondary value to set - * @return the BatchAccountListKeyResultInner object itself. + * @return the BatchAccountKeysInner object itself. */ - public BatchAccountListKeyResultInner withSecondary(String secondary) { + public BatchAccountKeysInner withSecondary(String secondary) { this.secondary = secondary; return this; } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountRegenerateKeyResultInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountRegenerateKeyResultInner.java deleted file mode 100644 index 717fb444937f..000000000000 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountRegenerateKeyResultInner.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * 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.implementation; - - -/** - * Values returned by the RegenerateKey operation. - */ -public class BatchAccountRegenerateKeyResultInner { - /** - * The primary key associated with the account. - */ - private String primary; - - /** - * The secondary key associated with the account. - */ - private String secondary; - - /** - * Get the primary value. - * - * @return the primary value - */ - public String primary() { - return this.primary; - } - - /** - * Set the primary value. - * - * @param primary the primary value to set - * @return the BatchAccountRegenerateKeyResultInner object itself. - */ - public BatchAccountRegenerateKeyResultInner withPrimary(String primary) { - this.primary = primary; - return this; - } - - /** - * Get the secondary value. - * - * @return the secondary value - */ - public String secondary() { - return this.secondary; - } - - /** - * Set the secondary value. - * - * @param secondary the secondary value to set - * @return the BatchAccountRegenerateKeyResultInner object itself. - */ - public BatchAccountRegenerateKeyResultInner withSecondary(String secondary) { - this.secondary = secondary; - return this; - } - -} diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java index 29f91e147749..e057a73f59cc 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java @@ -13,11 +13,11 @@ */ @LangDefinition public class BatchAccountsImpl - extends GroupableResourcesImpl + extends GroupableResourcesImpl implements BatchAccounts { private final StorageManager storageManager; - protected BatchAccountsImpl(AccountsInner innerCollection, BatchManager manager, StorageManager storageManager) { + protected BatchAccountsImpl(BatchAccountsInner innerCollection, BatchManager manager, StorageManager storageManager) { super(innerCollection, manager); this.storageManager = storageManager; } @@ -34,7 +34,7 @@ public void delete(String groupName, String name) { @Override protected BatchAccountImpl wrapModel(String name) { - AccountResourceInner inner = new AccountResourceInner(); + BatchAccountInner inner = new BatchAccountInner(); return new BatchAccountImpl( name, @@ -54,7 +54,7 @@ public PagedList listByGroup(String resourceGroupName) { } @Override - protected BatchAccountImpl wrapModel(AccountResourceInner inner) { + protected BatchAccountImpl wrapModel(BatchAccountInner inner) { return new BatchAccountImpl( inner.name(), inner, diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsInner.java similarity index 71% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsInner.java index b36117d75a83..ddfba39e7ef7 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsInner.java @@ -41,30 +41,30 @@ /** * An instance of this class provides access to all the operations defined - * in Accounts. + * in BatchAccounts. */ -public final class AccountsInner { +public final class BatchAccountsInner { /** The Retrofit service to perform REST calls. */ - private AccountsService service; + private BatchAccountsService service; /** The service client containing this operation class. */ private BatchManagementClientImpl client; /** - * Initializes an instance of AccountsInner. + * 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 AccountsInner(Retrofit retrofit, BatchManagementClientImpl client) { - this.service = retrofit.create(AccountsService.class); + public BatchAccountsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(BatchAccountsService.class); this.client = client; } /** - * The interface defining all the services for Accounts to be + * The interface defining all the services for BatchAccounts to be * used by Retrofit to perform actually REST calls. */ - interface AccountsService { + interface BatchAccountsService { @Headers("Content-Type: application/json; charset=utf-8") @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 BatchAccountCreateParametersInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -107,7 +107,7 @@ interface AccountsService { @Headers("Content-Type: application/json; charset=utf-8") @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys") - Observable> listKeys(@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); + 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") @GET("{nextLink}") @@ -125,9 +125,9 @@ interface AccountsService { * @param resourceGroupName The name of the resource group that contains the new 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. - * @return the AccountResourceInner object if successful. + * @return the BatchAccountInner object if successful. */ - public AccountResourceInner create(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + public BatchAccountInner create(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().getBody(); } @@ -140,7 +140,7 @@ public AccountResourceInner create(String resourceGroupName, String accountName, * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceCall createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { return ServiceCall.create(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -152,10 +152,10 @@ public ServiceCall createAsync(String resourceGroupName, S * @param parameters Additional parameters for account creation. * @return the observable for the request */ - public Observable createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { - return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, AccountResourceInner>() { + public Observable createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BatchAccountInner>() { @Override - public AccountResourceInner call(ServiceResponse response) { + public BatchAccountInner call(ServiceResponse response) { return response.getBody(); } }); @@ -169,7 +169,7 @@ public AccountResourceInner call(ServiceResponse response) * @param parameters Additional parameters for account creation. * @return the observable for the request */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -187,7 +187,7 @@ public Observable> createWithServiceRespon } 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().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -196,9 +196,9 @@ public Observable> createWithServiceRespon * @param resourceGroupName The name of the resource group that contains the new 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. - * @return the AccountResourceInner object if successful. + * @return the BatchAccountInner object if successful. */ - public AccountResourceInner beginCreate(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + public BatchAccountInner beginCreate(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().getBody(); } @@ -211,7 +211,7 @@ public AccountResourceInner beginCreate(String resourceGroupName, String account * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceCall beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { return ServiceCall.create(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -221,12 +221,12 @@ public ServiceCall beginCreateAsync(String resourceGroupNa * @param resourceGroupName The name of the resource group that contains the new 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. - * @return the observable to the AccountResourceInner object + * @return the observable to the BatchAccountInner object */ - public Observable beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { - return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, AccountResourceInner>() { + public Observable beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BatchAccountInner>() { @Override - public AccountResourceInner call(ServiceResponse response) { + public BatchAccountInner call(ServiceResponse response) { return response.getBody(); } }); @@ -238,9 +238,9 @@ public AccountResourceInner call(ServiceResponse response) * @param resourceGroupName The name of the resource group that contains the new 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. - * @return the observable to the AccountResourceInner object + * @return the observable to the BatchAccountInner object */ - public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -258,11 +258,11 @@ public Observable> beginCreateWithServiceR } 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>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = beginCreateDelegate(response); + ServiceResponse clientResponse = beginCreateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -271,10 +271,10 @@ public Observable> call(Response beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.mapperAdapter()) .register(202, new TypeToken() { }.getType()) - .register(200, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -285,9 +285,9 @@ private ServiceResponse beginCreateDelegate(Response updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters, final ServiceCallback serviceCallback) { + public ServiceCall updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters, final ServiceCallback serviceCallback) { return ServiceCall.create(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } @@ -310,12 +310,12 @@ public ServiceCall updateAsync(String resourceGroupName, S * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. * @param parameters Additional parameters for account update. - * @return the observable to the AccountResourceInner object + * @return the observable to the BatchAccountInner object */ - public Observable updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { - return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, AccountResourceInner>() { + public Observable updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, BatchAccountInner>() { @Override - public AccountResourceInner call(ServiceResponse response) { + public BatchAccountInner call(ServiceResponse response) { return response.getBody(); } }); @@ -327,9 +327,9 @@ public AccountResourceInner call(ServiceResponse response) * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. * @param parameters Additional parameters for account update. - * @return the observable to the AccountResourceInner object + * @return the observable to the BatchAccountInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -347,11 +347,11 @@ public Observable> updateWithServiceRespon } 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>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -360,9 +360,9 @@ public Observable> call(Response updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -514,9 +514,9 @@ private ServiceResponse beginDeleteDelegate(Response respons * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. - * @return the AccountResourceInner object if successful. + * @return the BatchAccountInner object if successful. */ - public AccountResourceInner get(String resourceGroupName, String accountName) { + public BatchAccountInner get(String resourceGroupName, String accountName) { return getWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } @@ -528,7 +528,7 @@ public AccountResourceInner get(String resourceGroupName, String accountName) { * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + public ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } @@ -537,12 +537,12 @@ public ServiceCall getAsync(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. - * @return the observable to the AccountResourceInner object + * @return the observable to the BatchAccountInner object */ - public Observable getAsync(String resourceGroupName, String accountName) { - return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountResourceInner>() { + public Observable getAsync(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BatchAccountInner>() { @Override - public AccountResourceInner call(ServiceResponse response) { + public BatchAccountInner call(ServiceResponse response) { return response.getBody(); } }); @@ -553,9 +553,9 @@ public AccountResourceInner call(ServiceResponse response) * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. - * @return the observable to the AccountResourceInner object + * @return the observable to the BatchAccountInner object */ - public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -569,11 +569,11 @@ public Observable> getWithServiceResponseA throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.get(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = getDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -582,9 +582,9 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -592,13 +592,13 @@ private ServiceResponse getDelegate(Response /** * Gets information about the Batch accounts associated with the subscription. * - * @return the PagedList<AccountResourceInner> object if successful. + * @return the PagedList<BatchAccountInner> object if successful. */ - public PagedList list() { - ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - return new PagedList(response.getBody()) { + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.getBody()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; @@ -610,12 +610,12 @@ public Page nextPage(String nextPageLink) { * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall> listAsync(final ListOperationCallback serviceCallback) { + public ServiceCall> listAsync(final ListOperationCallback serviceCallback) { return AzureServiceCall.create( listSinglePageAsync(), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, @@ -625,13 +625,13 @@ public Observable>> call(String nextP /** * Gets information about the Batch accounts associated with the subscription. * - * @return the observable to the PagedList<AccountResourceInner> object + * @return the observable to the PagedList<BatchAccountInner> object */ - public Observable> listAsync() { + public Observable> listAsync() { return listWithServiceResponseAsync() - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.getBody(); } }); @@ -640,13 +640,13 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync() { + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -659,9 +659,9 @@ public Observable>> call(ServiceRespo /** * Gets information about the Batch accounts associated with the subscription. * - * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BatchAccountInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync() { + public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -669,12 +669,12 @@ public Observable>> listSinglePageAsy 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>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); } catch (Throwable t) { return Observable.error(t); } @@ -682,9 +682,9 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -693,13 +693,13 @@ private ServiceResponse> listDelegate(Response listByResourceGroup(final String resourceGroupName) { - ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - return new PagedList(response.getBody()) { + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.getBody()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; @@ -712,12 +712,12 @@ public Page nextPage(String nextPageLink) { * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + public ServiceCall> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { return AzureServiceCall.create( listByResourceGroupSinglePageAsync(resourceGroupName), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, @@ -728,13 +728,13 @@ public Observable>> call(String nextP * Gets information about the Batch accounts associated within the specified resource group. * * @param resourceGroupName The name of the resource group whose Batch accounts to list. - * @return the observable to the PagedList<AccountResourceInner> object + * @return the observable to the PagedList<BatchAccountInner> object */ - public Observable> listByResourceGroupAsync(final String resourceGroupName) { + public Observable> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.getBody(); } }); @@ -744,13 +744,13 @@ public Page call(ServiceResponse>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { return listByResourceGroupSinglePageAsync(resourceGroupName) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -763,10 +763,10 @@ public Observable>> call(ServiceRespo /** * Gets information about the Batch accounts associated within the specified resource group. * - ServiceResponse> * @param resourceGroupName The name of the resource group whose Batch accounts to list. - * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + ServiceResponse> * @param resourceGroupName The name of the resource group whose Batch accounts to list. + * @return the PagedList<BatchAccountInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -777,12 +777,12 @@ public Observable>> listByResourceGro 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>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupDelegate(response); - return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); } catch (Throwable t) { return Observable.error(t); } @@ -790,9 +790,9 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -881,9 +881,9 @@ private ServiceResponse synchronizeAutoStorageKeysDelegate(Response regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName, final ServiceCallback serviceCallback) { + public ServiceCall regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName, final ServiceCallback serviceCallback) { return ServiceCall.create(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); } @@ -906,12 +906,12 @@ public ServiceCall regenerateKeyAsync(Stri * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' - * @return the observable to the BatchAccountRegenerateKeyResultInner object + * @return the observable to the BatchAccountKeysInner object */ - public Observable regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { - return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, BatchAccountRegenerateKeyResultInner>() { + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, BatchAccountKeysInner>() { @Override - public BatchAccountRegenerateKeyResultInner call(ServiceResponse response) { + public BatchAccountKeysInner call(ServiceResponse response) { return response.getBody(); } }); @@ -923,9 +923,9 @@ public BatchAccountRegenerateKeyResultInner call(ServiceResponse> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -944,11 +944,11 @@ public Observable> regener 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>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = regenerateKeyDelegate(response); + ServiceResponse clientResponse = regenerateKeyDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -957,60 +957,60 @@ public Observable> call(Re }); } - private ServiceResponse regenerateKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse regenerateKeyDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Lists the account keys for the specified Batch account. + * Gets the account keys for the specified Batch account. * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. - * @return the BatchAccountListKeyResultInner object if successful. + * @return the BatchAccountKeysInner object if successful. */ - public BatchAccountListKeyResultInner listKeys(String resourceGroupName, String accountName) { - return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); + public BatchAccountKeysInner getKeys(String resourceGroupName, String accountName) { + return getKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** - * Lists the account keys for the specified Batch account. + * Gets the account keys for the specified Batch account. * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + public ServiceCall getKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceCall.create(getKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** - * Lists the account keys for the specified Batch account. + * Gets the account keys for the specified Batch account. * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. - * @return the observable to the BatchAccountListKeyResultInner object + * @return the observable to the BatchAccountKeysInner object */ - public Observable listKeysAsync(String resourceGroupName, String accountName) { - return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BatchAccountListKeyResultInner>() { + public Observable getKeysAsync(String resourceGroupName, String accountName) { + return getKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BatchAccountKeysInner>() { @Override - public BatchAccountListKeyResultInner call(ServiceResponse response) { + public BatchAccountKeysInner call(ServiceResponse response) { return response.getBody(); } }); } /** - * Lists the account keys for the specified Batch account. + * Gets the account keys for the specified Batch account. * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the account. - * @return the observable to the BatchAccountListKeyResultInner object + * @return the observable to the BatchAccountKeysInner object */ - public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { + public Observable> getKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1023,12 +1023,12 @@ public Observable> listKeysWithS if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + 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) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = listKeysDelegate(response); + ServiceResponse clientResponse = getKeysDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1037,9 +1037,9 @@ public Observable> call(Response }); } - private ServiceResponse listKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -1048,13 +1048,13 @@ private ServiceResponse listKeysDelegate(Respons * Gets information about the Batch accounts associated with the subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the PagedList<AccountResourceInner> object if successful. + * @return the PagedList<BatchAccountInner> object if successful. */ - public PagedList listNext(final String nextPageLink) { - ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.getBody()) { + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.getBody()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; @@ -1068,12 +1068,12 @@ public Page nextPage(String nextPageLink) { * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall> listNextAsync(final String nextPageLink, final ServiceCall> serviceCall, final ListOperationCallback serviceCallback) { + public ServiceCall> listNextAsync(final String nextPageLink, final ServiceCall> serviceCall, final ListOperationCallback serviceCallback) { return AzureServiceCall.create( listNextSinglePageAsync(nextPageLink), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, @@ -1084,13 +1084,13 @@ public Observable>> call(String nextP * Gets information about the Batch accounts associated with the subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the PagedList<AccountResourceInner> object + * @return the observable to the PagedList<BatchAccountInner> object */ - public Observable> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.getBody(); } }); @@ -1100,13 +1100,13 @@ public Page call(ServiceResponse>> listNextWithServiceResponseAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -1119,20 +1119,20 @@ public Observable>> call(ServiceRespo /** * Gets information about the Batch accounts associated with the subscription. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<BatchAccountInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listNextSinglePageAsync(final String nextPageLink) { + public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } return service.listNext(nextPageLink, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); - return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); } catch (Throwable t) { return Observable.error(t); } @@ -1140,9 +1140,9 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -1151,13 +1151,13 @@ private ServiceResponse> listNextDelegate(Respons * Gets information about the Batch accounts associated within the specified resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the PagedList<AccountResourceInner> object if successful. + * @return the PagedList<BatchAccountInner> object if successful. */ - public PagedList listByResourceGroupNext(final String nextPageLink) { - ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.getBody()) { + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.getBody()) { @Override - public Page nextPage(String nextPageLink) { + public Page nextPage(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; @@ -1171,12 +1171,12 @@ public Page nextPage(String nextPageLink) { * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall> listByResourceGroupNextAsync(final String nextPageLink, final ServiceCall> serviceCall, final ListOperationCallback serviceCallback) { + public ServiceCall> listByResourceGroupNextAsync(final String nextPageLink, final ServiceCall> serviceCall, final ListOperationCallback serviceCallback) { return AzureServiceCall.create( listByResourceGroupNextSinglePageAsync(nextPageLink), - new Func1>>>() { + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { + public Observable>> call(String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink); } }, @@ -1187,13 +1187,13 @@ public Observable>> call(String nextP * Gets information about the Batch accounts associated within the specified resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the PagedList<AccountResourceInner> object + * @return the observable to the PagedList<BatchAccountInner> object */ - public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.getBody(); } }); @@ -1203,13 +1203,13 @@ public Page call(ServiceResponse>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); if (nextPageLink == null) { return Observable.just(page); @@ -1222,20 +1222,20 @@ public Observable>> call(ServiceRespo /** * Gets information about the Batch accounts associated within the specified resource group. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the PagedList<BatchAccountInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } return service.listByResourceGroupNext(nextPageLink, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listByResourceGroupNextDelegate(response); - return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.getBody(), result.getResponse())); } catch (Throwable t) { return Observable.error(t); } @@ -1243,9 +1243,9 @@ public Observable>> call(Response> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder, CloudException>(this.client.mapperAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionQuotasGetResultInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchLocationQuotaInner.java similarity index 75% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionQuotasGetResultInner.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchLocationQuotaInner.java index 0a9e58475192..cd7da1e55f29 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionQuotasGetResultInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchLocationQuotaInner.java @@ -10,9 +10,9 @@ /** - * Values returned by the Get Subscription Quotas operation. + * Quotas associated with a Batch region for a particular subscription. */ -public class SubscriptionQuotasGetResultInner { +public class BatchLocationQuotaInner { /** * The number of Batch accounts that may be created under the subscription * in the specified region. @@ -32,9 +32,9 @@ public Integer accountQuota() { * Set the accountQuota value. * * @param accountQuota the accountQuota value to set - * @return the SubscriptionQuotasGetResultInner object itself. + * @return the BatchLocationQuotaInner object itself. */ - public SubscriptionQuotasGetResultInner withAccountQuota(Integer accountQuota) { + public BatchLocationQuotaInner withAccountQuota(Integer accountQuota) { this.accountQuota = accountQuota; return this; } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManagementClientImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManagementClientImpl.java index 0094d4087f0e..aee23cd4b6cd 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManagementClientImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManagementClientImpl.java @@ -133,16 +133,29 @@ public BatchManagementClientImpl withGenerateClientRequestId(boolean generateCli } /** - * The AccountsInner object to access its operations. + * The BatchAccountsInner object to access its operations. */ - private AccountsInner accounts; + private BatchAccountsInner batchAccounts; /** - * Gets the AccountsInner object to access its operations. - * @return the AccountsInner object. + * Gets the BatchAccountsInner object to access its operations. + * @return the BatchAccountsInner object. */ - public AccountsInner accounts() { - return this.accounts; + 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; } /** @@ -159,16 +172,16 @@ public ApplicationsInner applications() { } /** - * The SubscriptionsInner object to access its operations. + * The LocationsInner object to access its operations. */ - private SubscriptionsInner subscriptions; + private LocationsInner locations; /** - * Gets the SubscriptionsInner object to access its operations. - * @return the SubscriptionsInner object. + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. */ - public SubscriptionsInner subscriptions() { - return this.subscriptions; + public LocationsInner locations() { + return this.locations; } /** @@ -208,9 +221,10 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; - this.accounts = new AccountsInner(restClient().retrofit(), this); + this.batchAccounts = new BatchAccountsInner(restClient().retrofit(), this); + this.applicationPackages = new ApplicationPackagesInner(restClient().retrofit(), this); this.applications = new ApplicationsInner(restClient().retrofit(), this); - this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManager.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManager.java index cae261798119..a88bc7af264c 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManager.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchManager.java @@ -88,7 +88,7 @@ public BatchManager authenticate(ServiceClientCredentials credentials, String su */ public BatchAccounts batchAccounts() { if (batchAccounts == null) { - batchAccounts = new BatchAccountsImpl(super.innerManagementClient.accounts(), this, this.storageManager); + batchAccounts = new BatchAccountsImpl(super.innerManagementClient.batchAccounts(), this, this.storageManager); } return batchAccounts; diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/LocationsInner.java similarity index 50% rename from azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java rename to azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/LocationsInner.java index 621c91676a54..665b61d312f5 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/LocationsInner.java @@ -28,79 +28,79 @@ /** * An instance of this class provides access to all the operations defined - * in Subscriptions. + * in Locations. */ -public final class SubscriptionsInner { +public final class LocationsInner { /** The Retrofit service to perform REST calls. */ - private SubscriptionsService service; + private LocationsService service; /** The service client containing this operation class. */ private BatchManagementClientImpl client; /** - * Initializes an instance of SubscriptionsInner. + * 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 SubscriptionsInner(Retrofit retrofit, BatchManagementClientImpl client) { - this.service = retrofit.create(SubscriptionsService.class); + public LocationsInner(Retrofit retrofit, BatchManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); this.client = client; } /** - * The interface defining all the services for Subscriptions to be + * The interface defining all the services for Locations to be * used by Retrofit to perform actually REST calls. */ - interface SubscriptionsService { + interface LocationsService { @Headers("Content-Type: application/json; charset=utf-8") @GET("subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas") - Observable> getSubscriptionQuotas(@Path("locationName") String locationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + 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); } /** - * Gets the Batch service quotas for the specified suscription. + * Gets the Batch service quotas for the specified subscription at the given location. * * @param locationName The desired region for the quotas. - * @return the SubscriptionQuotasGetResultInner object if successful. + * @return the BatchLocationQuotaInner object if successful. */ - public SubscriptionQuotasGetResultInner getSubscriptionQuotas(String locationName) { - return getSubscriptionQuotasWithServiceResponseAsync(locationName).toBlocking().single().getBody(); + public BatchLocationQuotaInner getQuotas(String locationName) { + return getQuotasWithServiceResponseAsync(locationName).toBlocking().single().getBody(); } /** - * Gets the Batch service quotas for the specified suscription. + * Gets the Batch service quotas for the specified subscription at the given location. * * @param locationName The desired region for the quotas. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall getSubscriptionQuotasAsync(String locationName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSubscriptionQuotasWithServiceResponseAsync(locationName), serviceCallback); + public ServiceCall getQuotasAsync(String locationName, final ServiceCallback serviceCallback) { + return ServiceCall.create(getQuotasWithServiceResponseAsync(locationName), serviceCallback); } /** - * Gets the Batch service quotas for the specified suscription. + * Gets the Batch service quotas for the specified subscription at the given location. * * @param locationName The desired region for the quotas. - * @return the observable to the SubscriptionQuotasGetResultInner object + * @return the observable to the BatchLocationQuotaInner object */ - public Observable getSubscriptionQuotasAsync(String locationName) { - return getSubscriptionQuotasWithServiceResponseAsync(locationName).map(new Func1, SubscriptionQuotasGetResultInner>() { + public Observable getQuotasAsync(String locationName) { + return getQuotasWithServiceResponseAsync(locationName).map(new Func1, BatchLocationQuotaInner>() { @Override - public SubscriptionQuotasGetResultInner call(ServiceResponse response) { + public BatchLocationQuotaInner call(ServiceResponse response) { return response.getBody(); } }); } /** - * Gets the Batch service quotas for the specified suscription. + * Gets the Batch service quotas for the specified subscription at the given location. * * @param locationName The desired region for the quotas. - * @return the observable to the SubscriptionQuotasGetResultInner object + * @return the observable to the BatchLocationQuotaInner object */ - public Observable> getSubscriptionQuotasWithServiceResponseAsync(String locationName) { + public Observable> getQuotasWithServiceResponseAsync(String locationName) { if (locationName == null) { throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); } @@ -110,12 +110,12 @@ public Observable> getSubscrip if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.getSubscriptionQuotas(locationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + 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) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getSubscriptionQuotasDelegate(response); + ServiceResponse clientResponse = getQuotasDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -124,9 +124,9 @@ public Observable> call(Respon }); } - private ServiceResponse getSubscriptionQuotasDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return new AzureServiceResponseBuilder(this.client.mapperAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getQuotasDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return new AzureServiceResponseBuilder(this.client.mapperAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); }