diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionClientImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionClientImpl.java index 8c855033ebb..7c0ab796e6a 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionClientImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionClientImpl.java @@ -28,6 +28,29 @@ public AzureClient getAzureClient() { return this.azureClient; } + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public SubscriptionClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /** The API version to use for the operation. */ private String apiVersion; diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java index 27d253e39c0..6d8737138bf 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsInner.java @@ -79,39 +79,36 @@ interface SubscriptionsService { * Gets all available geo-locations. * This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List<LocationInner> object if successful. */ - public List listLocations(String subscriptionId) { - return listLocationsWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + public List listLocations() { + return listLocationsWithServiceResponseAsync().toBlocking().single().body(); } /** * Gets all available geo-locations. * This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listLocationsAsync(String subscriptionId, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listLocationsWithServiceResponseAsync(subscriptionId), serviceCallback); + public ServiceFuture> listLocationsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listLocationsWithServiceResponseAsync(), serviceCallback); } /** * Gets all available geo-locations. * This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<LocationInner> object */ - public Observable> listLocationsAsync(String subscriptionId) { - return listLocationsWithServiceResponseAsync(subscriptionId).map(new Func1>, List>() { + public Observable> listLocationsAsync() { + return listLocationsWithServiceResponseAsync().map(new Func1>, List>() { @Override public List call(ServiceResponse> response) { return response.body(); @@ -123,18 +120,17 @@ public List call(ServiceResponse> response) { * Gets all available geo-locations. * This operation provides all the locations that are available for resource providers; however, each resource provider may support a subset of this list. * - * @param subscriptionId The ID of the target subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<LocationInner> object */ - public Observable>> listLocationsWithServiceResponseAsync(String subscriptionId) { - if (subscriptionId == null) { - throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + public Observable>> listLocationsWithServiceResponseAsync() { + 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.listLocations(subscriptionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.listLocations(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -159,37 +155,34 @@ private ServiceResponse> listLocationsDelegate(Response< /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SubscriptionInner object if successful. */ - public SubscriptionInner get(String subscriptionId) { - return getWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + public SubscriptionInner get() { + return getWithServiceResponseAsync().toBlocking().single().body(); } /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getAsync(String subscriptionId, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(subscriptionId), serviceCallback); + public ServiceFuture getAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(), serviceCallback); } /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SubscriptionInner object */ - public Observable getAsync(String subscriptionId) { - return getWithServiceResponseAsync(subscriptionId).map(new Func1, SubscriptionInner>() { + public Observable getAsync() { + return getWithServiceResponseAsync().map(new Func1, SubscriptionInner>() { @Override public SubscriptionInner call(ServiceResponse response) { return response.body(); @@ -200,18 +193,17 @@ public SubscriptionInner call(ServiceResponse response) { /** * Gets details about a specified subscription. * - * @param subscriptionId The ID of the target subscription. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SubscriptionInner object */ - public Observable> getWithServiceResponseAsync(String subscriptionId) { - if (subscriptionId == null) { - throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + public Observable> getWithServiceResponseAsync() { + 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(subscriptionId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.get(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {