diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml b/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml index 98f72fb94143..6d091c6304ef 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-appplatform - 1.0.0-beta-1 + 1.0.0-beta jar Microsoft Azure SDK for AppPlatform Management This package contains Microsoft AppPlatform Management SDK. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java index e76e0a7f25e0..11342249c40e 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResource.java @@ -16,7 +16,6 @@ import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.implementation.AppPlatformManager; -import org.joda.time.DateTime; /** * Type representing AppResource. @@ -27,6 +26,11 @@ public interface AppResource extends HasInner, Indexable, Upda */ String id(); + /** + * @return the location value. + */ + String location(); + /** * @return the name value. */ @@ -45,7 +49,7 @@ public interface AppResource extends HasInner, Indexable, Upda /** * The entirety of the AppResource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithResourceGroupName, DefinitionStages.WithServiceName, DefinitionStages.WithCreate { } /** @@ -79,18 +83,30 @@ interface WithServiceName { * @param serviceName The name of the Service resource * @return the next definition stage */ - WithProperties withServiceName(String serviceName); + WithCreate withServiceName(String serviceName); + } + + /** + * The stage of the appresource definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The GEO location of the application, always the same with its parent resource + * @return the next definition stage + */ + WithCreate withLocation(String location); } /** * The stage of the appresource definition allowing to specify Properties. */ interface WithProperties { - /** - * Specifies properties. - * @param properties Properties of the App resource - * @return the next definition stage - */ + /** + * Specifies properties. + * @param properties Properties of the App resource + * @return the next definition stage + */ WithCreate withProperties(AppResourceProperties properties); } @@ -99,19 +115,31 @@ interface WithProperties { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable { + interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithProperties { } } /** * The template for a AppResource update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithProperties { + interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithProperties { } /** * Grouping of AppResource update stages. */ interface UpdateStages { + /** + * The stage of the appresource update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The GEO location of the application, always the same with its parent resource + * @return the next update stage + */ + Update withLocation(String location); + } + /** * The stage of the appresource update allowing to specify Properties. */ diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java index 272ff8751b6c..c9c15bd9ccb3 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProperties.java @@ -29,7 +29,7 @@ public class AppResourceProperties { /** * Provisioning state of the App. Possible values include: 'Succeeded', - * 'Failed'. + * 'Failed', 'Creating', 'Updating'. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private AppResourceProvisioningState provisioningState; @@ -88,7 +88,7 @@ public String url() { } /** - * Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed'. + * Get provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating'. * * @return the provisioningState value */ diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java index 75583dfa840c..5de11d53fd2d 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/AppResourceProvisioningState.java @@ -22,6 +22,12 @@ public final class AppResourceProvisioningState extends ExpandableStringEnum createOrUpdateAsync(String resourceGroupName, String serviceName); + Observable createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource); /** * Operation to delete a Service. @@ -50,10 +52,11 @@ public interface Services { * * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable updateAsync(String resourceGroupName, String serviceName); + Observable updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource); /** * Regenerate a test key for a Service. diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java index 6e5eb0418d75..94ae1b62eaab 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppPlatformManagementClientImpl.java @@ -10,6 +10,8 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.LongRunningFinalState; +import com.microsoft.azure.LongRunningOperationOptions; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceImpl.java index ad69132cf992..5759b3f904cd 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceImpl.java @@ -13,15 +13,11 @@ import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; import com.microsoft.azure.management.appplatform.v2019_05_01_preview.AppResourceProperties; -import org.joda.time.DateTime; -import rx.functions.Func1; class AppResourceImpl extends CreatableUpdatableImpl implements AppResource, AppResource.Definition, AppResource.Update { private String resourceGroupName; private String serviceName; private String appName; - private AppResourceProperties cproperties; - private AppResourceProperties uproperties; private final AppPlatformManager manager; AppResourceImpl(String name, AppPlatformManager manager) { @@ -30,8 +26,6 @@ class AppResourceImpl extends CreatableUpdatableImpl createResourceAsync() { AppsInner client = this.manager().inner().apps(); - return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.cproperties) - .map(new Func1() { - @Override - public AppResourceInner call(AppResourceInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.createOrUpdateAsync(this.resourceGroupName, this.serviceName, this.appName, this.inner()) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { AppsInner client = this.manager().inner().apps(); - return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.uproperties) - .map(new Func1() { - @Override - public AppResourceInner call(AppResourceInner resource) { - resetCreateUpdateParameters(); - return resource; - } - }) + return client.updateAsync(this.resourceGroupName, this.serviceName, this.appName, this.inner()) .map(innerToFluentMap(this)); } @@ -92,16 +70,17 @@ public boolean isInCreateMode() { return this.inner().id() == null; } - private void resetCreateUpdateParameters() { - this.cproperties = new AppResourceProperties(); - this.uproperties = new AppResourceProperties(); - } @Override public String id() { return this.inner().id(); } + @Override + public String location() { + return this.inner().location(); + } + @Override public String name() { return this.inner().name(); @@ -129,13 +108,15 @@ public AppResourceImpl withServiceName(String serviceName) { return this; } + @Override + public AppResourceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + @Override public AppResourceImpl withProperties(AppResourceProperties properties) { - if (isInCreateMode()) { - this.cproperties = properties; - } else { - this.uproperties = properties; - } + this.inner().withProperties(properties); return this; } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java index ff55fc32e1d9..673074e37c0b 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppResourceInner.java @@ -22,6 +22,13 @@ public class AppResourceInner extends ProxyResource { @JsonProperty(value = "properties") private AppResourceProperties properties; + /** + * The GEO location of the application, always the same with its parent + * resource. + */ + @JsonProperty(value = "location") + private String location; + /** * Get properties of the App resource. * @@ -42,4 +49,24 @@ public AppResourceInner withProperties(AppResourceProperties properties) { return this; } + /** + * Get the GEO location of the application, always the same with its parent resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the GEO location of the application, always the same with its parent resource. + * + * @param location the location value to set + * @return the AppResourceInner object itself. + */ + public AppResourceInner withLocation(String location) { + this.location = location; + return this; + } + } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java index 70e18cc35be9..aaeaf61a47d3 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/AppsInner.java @@ -13,7 +13,6 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.management.appplatform.v2019_05_01_preview.AppResourceProperties; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -66,11 +65,15 @@ public AppsInner(Retrofit retrofit, AppPlatformManagementClientImpl client) { interface AppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("syncStatus") String syncStatus, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Query("syncStatus") String syncStatus, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AppResourceInner appResource, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}", method = "DELETE", hasBody = true) @@ -78,7 +81,11 @@ interface AppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body AppResourceInner appResource, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Body AppResourceInner appResource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Apps list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps") @@ -164,7 +171,7 @@ public Observable> getWithServiceResponseAsync throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } final String syncStatus = null; - return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, syncStatus, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), syncStatus, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -251,7 +258,7 @@ public Observable> getWithServiceResponseAsync if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, syncStatus, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.get(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), syncStatus, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -278,13 +285,14 @@ private ServiceResponse getDelegate(Response res * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + public AppResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().last().body(); } /** @@ -293,12 +301,13 @@ public AppResourceInner createOrUpdate(String resourceGroupName, String serviceN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -307,11 +316,12 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, AppResourceInner>() { + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -325,10 +335,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -341,21 +352,12 @@ public Observable> createOrUpdateWithServiceRe if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - final AppResourceProperties properties = null; - AppResourceInner appResource = new AppResourceInner(); - appResource.withProperties(null); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); + } + Validator.validate(appResource); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -364,14 +366,14 @@ public Observable> call(Response * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner createOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).toBlocking().single().body(); + public AppResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().single().body(); } /** @@ -380,13 +382,13 @@ public AppResourceInner createOrUpdate(String resourceGroupName, String serviceN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties), serviceCallback); + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -395,12 +397,12 @@ public ServiceFuture createOrUpdateAsync(String resourceGroupN * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).map(new Func1, AppResourceInner>() { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -414,11 +416,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the create or update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -431,18 +433,16 @@ public Observable> createOrUpdateWithServiceRe if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - Validator.validate(properties); - AppResourceInner appResource = null; - if (properties != null) { - appResource = new AppResourceInner(); - appResource.withProperties(properties); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); } - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) + Validator.validate(appResource); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = createOrUpdateDelegate(response); + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -451,9 +451,10 @@ public Observable> call(Response }); } - private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -554,13 +555,14 @@ private ServiceResponse deleteDelegate(Response response) th * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner update(String resourceGroupName, String serviceName, String appName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName).toBlocking().single().body(); + public AppResourceInner update(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().last().body(); } /** @@ -569,12 +571,13 @@ public AppResourceInner update(String resourceGroupName, String serviceName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String serviceName, String appName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName), serviceCallback); + public ServiceFuture updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -583,11 +586,12 @@ public ServiceFuture updateAsync(String resourceGroupName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable updateAsync(String resourceGroupName, String serviceName, String appName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName).map(new Func1, AppResourceInner>() { + public Observable updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -601,10 +605,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the AppResourceInner object + * @return the observable for the request */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -617,21 +622,12 @@ public Observable> updateWithServiceResponseAs if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - final AppResourceProperties properties = null; - AppResourceInner appResource = new AppResourceInner(); - appResource.withProperties(null); - return service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); + } + Validator.validate(appResource); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -640,14 +636,14 @@ public Observable> call(Response * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the AppResourceInner object if successful. */ - public AppResourceInner update(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).toBlocking().single().body(); + public AppResourceInner beginUpdate(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).toBlocking().single().body(); } /** @@ -656,13 +652,13 @@ public AppResourceInner update(String resourceGroupName, String serviceName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties), serviceCallback); + public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource), serviceCallback); } /** @@ -671,12 +667,12 @@ public ServiceFuture updateAsync(String resourceGroupName, Str * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable updateAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName, appName, properties).map(new Func1, AppResourceInner>() { + public Observable beginUpdateAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName, appName, appResource).map(new Func1, AppResourceInner>() { @Override public AppResourceInner call(ServiceResponse response) { return response.body(); @@ -690,11 +686,11 @@ public AppResourceInner call(ServiceResponse response) { * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. * @param serviceName The name of the Service resource. * @param appName The name of the App resource. - * @param properties Properties of the App resource + * @param appResource Parameters for the update operation * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the AppResourceInner object */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceProperties properties) { + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -707,18 +703,16 @@ public Observable> updateWithServiceResponseAs if (appName == null) { throw new IllegalArgumentException("Parameter appName is required and cannot be null."); } - Validator.validate(properties); - AppResourceInner appResource = null; - if (properties != null) { - appResource = new AppResourceInner(); - appResource.withProperties(properties); + if (appResource == null) { + throw new IllegalArgumentException("Parameter appResource is required and cannot be null."); } - return service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), this.client.acceptLanguage(), appResource, this.client.userAgent()) + Validator.validate(appResource); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), appResource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = updateDelegate(response); + ServiceResponse clientResponse = beginUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -727,9 +721,10 @@ public Observable> call(Response }); } - private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java index eb4453ff46de..36790bb837aa 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/BindingsInner.java @@ -360,11 +360,8 @@ public Observable> createOrUpdateWithServi throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); } Validator.validate(properties); - BindingResourceInner bindingResource = null; - if (properties != null) { - bindingResource = new BindingResourceInner(); - bindingResource.withProperties(properties); - } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -657,11 +654,8 @@ public Observable> updateWithServiceRespon throw new IllegalArgumentException("Parameter bindingName is required and cannot be null."); } Validator.validate(properties); - BindingResourceInner bindingResource = null; - if (properties != null) { - bindingResource = new BindingResourceInner(); - bindingResource.withProperties(properties); - } + BindingResourceInner bindingResource = new BindingResourceInner(); + bindingResource.withProperties(properties); return service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, bindingName, this.client.apiVersion(), this.client.acceptLanguage(), bindingResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java index cc60083c5c06..c4488fa12457 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/DeploymentsInner.java @@ -40,8 +40,6 @@ import rx.Observable; import com.microsoft.azure.LongRunningFinalState; import com.microsoft.azure.LongRunningOperationOptions; -import com.microsoft.azure.LongRunningFinalState; -import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -95,11 +93,11 @@ interface DeploymentsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments") - Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Path("appName") String appName, @Query("api-version") String apiVersion, @Query("version") String version, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments listClusterAllDeployments" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments") - Observable> listClusterAllDeployments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("version") String version, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listClusterAllDeployments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Query("version") String version, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Deployments start" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start") @@ -399,11 +397,8 @@ public Observable> createOrUpdateWithSe throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -582,11 +577,8 @@ public Observable> beginCreateOrUpdateW throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -869,11 +861,8 @@ public Observable> updateWithServiceRes throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -1052,11 +1041,8 @@ public Observable> beginUpdateWithServi throw new IllegalArgumentException("Parameter deploymentName is required and cannot be null."); } Validator.validate(properties); - DeploymentResourceInner deploymentResource = null; - if (properties != null) { - deploymentResource = new DeploymentResourceInner(); - deploymentResource.withProperties(properties); - } + DeploymentResourceInner deploymentResource = new DeploymentResourceInner(); + deploymentResource.withProperties(properties); return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, appName, deploymentName, this.client.apiVersion(), this.client.acceptLanguage(), deploymentResource, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override @@ -1188,7 +1174,7 @@ public Observable>> listSinglePage } final List version = null; String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1316,7 +1302,7 @@ public Observable>> listSinglePage } Validator.validate(version); String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, serviceName, appName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1438,7 +1424,7 @@ public Observable>> listClusterAll } final List version = null; String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1558,7 +1544,7 @@ public Observable>> listClusterAll } Validator.validate(version); String versionConverted = this.client.serializerAdapter().serializeList(version, CollectionFormat.MULTI); - return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, versionConverted, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listClusterAllDeployments(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), versionConverted, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java index 377b9a7f7fdd..8bd1c5bf441c 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesImpl.java @@ -46,9 +46,9 @@ public ServiceResource call(ServiceResourceInner inner) { } @Override - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName) { + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { ServicesInner client = this.inner(); - return client.createOrUpdateAsync(resourceGroupName, serviceName) + return client.createOrUpdateAsync(resourceGroupName, serviceName, resource) .map(new Func1() { @Override public ServiceResource call(ServiceResourceInner inner) { @@ -64,9 +64,9 @@ public Completable deleteAsync(String resourceGroupName, String serviceName) { } @Override - public Observable updateAsync(String resourceGroupName, String serviceName) { + public Observable updateAsync(String resourceGroupName, String serviceName, ServiceResourceInner resource) { ServicesInner client = this.inner(); - return client.updateAsync(resourceGroupName, serviceName) + return client.updateAsync(resourceGroupName, serviceName, resource) .map(new Func1() { @Override public ServiceResource call(ServiceResourceInner inner) { diff --git a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java index bb1d14453825..2bd3d9c1d88b 100644 --- a/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java +++ b/sdk/appplatform/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/appplatform/v2019_05_01_preview/implementation/ServicesInner.java @@ -75,11 +75,11 @@ interface ServicesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}", method = "DELETE", hasBody = true) @@ -91,11 +91,11 @@ interface ServicesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services beginUpdate" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") - Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Body ServiceResourceInner resource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Body ServiceResourceInner resource, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services listTestKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys") @@ -115,7 +115,7 @@ interface ServicesService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services checkNameAvailability" }) @POST("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability") - Observable> checkNameAvailability(@Path("location") String location, @Path("subscriptionId") String subscriptionId, @Body NameAvailabilityParameters availabilityParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body NameAvailabilityParameters availabilityParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appplatform.v2019_05_01_preview.Services list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") @@ -218,72 +218,6 @@ private ServiceResponse getByResourceGroupDelegate(Respons .build(response); } - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner createOrUpdate(String resourceGroupName, String serviceName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createOrUpdateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createOrUpdateAsync(String resourceGroupName, String serviceName) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } /** * Create a new Service or update an exiting Service. * @@ -350,88 +284,14 @@ public Observable> createOrUpdateWithServi if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner beginCreateOrUpdate(String resourceGroupName, String serviceName) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String serviceName) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Create a new Service or update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - /** * Create a new Service or update an exiting Service. * @@ -498,8 +358,11 @@ public Observable> beginCreateOrUpdateWith if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -669,72 +532,6 @@ private ServiceResponse beginDeleteDelegate(Response respons .build(response); } - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner update(String resourceGroupName, String serviceName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().last().body(); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture updateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable updateAsync(String resourceGroupName, String serviceName) { - return updateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } /** * Operation to update an exiting Service. * @@ -801,88 +598,14 @@ public Observable> updateWithServiceRespon if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ServiceResourceInner object if successful. - */ - public ServiceResourceInner beginUpdate(String resourceGroupName, String serviceName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().body(); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture beginUpdateAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable beginUpdateAsync(String resourceGroupName, String serviceName) { - return beginUpdateWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ServiceResourceInner>() { - @Override - public ServiceResourceInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Operation to update an exiting Service. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param serviceName The name of the Service resource. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ServiceResourceInner object - */ - public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (serviceName == null) { - throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); - } - final ServiceResourceInner resource = null; - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - /** * Operation to update an exiting Service. * @@ -949,8 +672,11 @@ public Observable> beginUpdateWithServiceR if (serviceName == null) { throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); } + if (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } Validator.validate(resource); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, resource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, serviceName, this.client.apiVersion(), resource, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1357,17 +1083,17 @@ public NameAvailabilityInner call(ServiceResponse respons * @return the observable to the NameAvailabilityInner object */ public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, NameAvailabilityParameters availabilityParameters) { - if (location == null) { - throw new IllegalArgumentException("Parameter location 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 (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } if (availabilityParameters == null) { throw new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null."); } Validator.validate(availabilityParameters); - return service.checkNameAvailability(location, this.client.subscriptionId(), availabilityParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), availabilityParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {